MeVisLab Scripting Reference
MLAB Class Reference

Inherits QObject.

Public Types

enum  LoadDicomTreeOptions { DicomNoOptions = MLABScriptDicom::DicomNoOptions , DicomReadPixelData = MLABScriptDicom::DicomReadPixelData , DicomReadPrivateTags = MLABScriptDicom::DicomReadPrivateTags }
 

Public Slots

Global state utility functions.


void clearMLCache ()
 
int getCacheAndLockedMemorySizeInKB ()
 
int getCacheAndLockedMemorySizeLimitInKB ()
 
int setNumberOfImageProcessingThreads (int numThreads)
 
int getNumberOfImageProcessingThreads ()
 
bool isDebug ()
 
bool isModuleProfilingEnabled ()
 
void setModuleProfilingEnabled (bool enabled)
 
QDateTime buildDate ()
 
QDateTime dateOfBuildJob ()
 
bool isWindows ()
 
bool isUnix ()
 
bool isLinux ()
 
bool isMacOS ()
 
QString systemId ()
 
QString detailedSystemId ()
 
QString systemInfo ()
 
QString computerModelInfo ()
 
QString compilerInfo ()
 
QString standaloneApplicationName ()
 
bool isStandaloneApplication ()
 
void writeRegistry ()
 
QString getenv (const QString &str)
 
bool hasVariable (const QString &name)
 
QString variable (const QString &name)
 
void setVariable (const QString &name, const QString &value)
 
void unsetVariable (const QString &name)
 
bool variableIsTrue (const QString &name)
 
QString readKey (const QString &application, const QString &key)
 
void writeKey (const QString &application, const QString &key, const QString &value)
 
bool isSpelledCorrectly (const QString &word)
 
QStringList getSpellingCorrectionSuggestions (const QString &word)
 
QString getAutomaticFieldTitle (const QString &name, bool splitUppercase)
 
bool loadLibrary (const QString &libraryName)
 
Running commands as external processes.


bool runActionOnFile (const QString &action, const QString &abspath)
 
bool openFile (const QString &abspath, int lineno=-1)
 
bool editFile (const QString &abspath)
 
bool openUrl (const QString &abspath)
 
bool runCommandDetached (const QString &command, const QStringList &arguments=QStringList(), const QString &workingDirectory=QString(), bool makeFrontmost=true)
 
bool runCommand (const QString &command, const QStringList &arguments=QStringList(), const QString &workingDir=QString())
 
QMap< QString, QVariant > runCommandStdInOut (const QString &command, const QStringList &arguments=QStringList(), const QString &workingDir=QString(), const QString &standardIn=QString())
 
bool runCommandInConsole (const QString &command, const QStringList &arguments=QStringList(), const QString &workingDir=QString(), const QString &standardIn=QString(), const QString &title=QString(), MLABWidgetControl *parent=nullptr, bool waitUntilFinished=false)
 
bool macIsApplicationRunning (const QString &bundleId)
 
bool macOpenFileInApplication (const QString &filePath, const QString &bundleId)
 
MLABScriptProcess * newProcess ()
 
void deleteProcess (MLABScriptProcess *process)
 
MLABHttpDownloadnewHttpDownload ()
 
Printing


MLABScriptPrinter * newPrinter ()
 
void deletePrinter (MLABScriptPrinter *process)
 
Logging to console.


void log (const QString &text)
 
void logFixed (const QString &text)
 
void logWarning (const QString &text)
 
void logError (const QString &text)
 
void logHTML (const QString &text)
 
void logWarningHTML (const QString &text)
 
void logErrorHTML (const QString &text)
 
void diagnosticLog (const QString &text)
 
void diagnosticLogHTML (const QString &text)
 
QString createHyperLink (const QString &absfile)
 
QString createHyperLinkFullPath (const QString &absfile)
 
QString createHyperLinkWithLine (const QString &absfile, long lineno)
 
bool setHighPrecisionLoggingTimeStampsEnabled (bool enabled)
 
Event processing


void processInventorQueue ()
 
bool shouldStop ()
 
void setShouldStop ()
 
void processEvents ()
 
void processEvents (bool allowUserInput)
 
void deleteUnreferencedWrappers ()
 
void terminate (int exitCode=0)
 
void exit (int code)
 
void setDontExitAfterConsoleCommand (bool dontExitAfterConsoleCommand)
 
bool enableBusyStateIndication (bool trueOrFalse)
 
void indicateBusyState (const QString &message=QString())
 
void setWaitCursor ()
 
void removeBusyStateIndicator ()
 
void removeWaitCursor ()
 
void setOverrideCursor (const QPixmap &pixmap)
 
void setOverrideCursor (const QString &filename)
 
void setOverrideCursor (const QString &filename, int hotspotx, int hotspoty)
 
void removeOverrideCursor ()
 
QPoint cursorPos ()
 
MLABWidgetControlmdlControlAtCurrentCursorPosition ()
 
MLABWidgetControlmdlControlAtGlobalPosition (const QPoint &globalPosition)
 
MLABWidgetControlmdlControlAtGlobalPosition (int x, int y)
 
void sleep (int secs)
 
void msleep (int msecs)
 
void usleep (int usecs)
 
MLABWidgetControlenterModalClickGrabber ()
 
Dragging

You can optionally specify an icon to show while dragging.

If you don't give a hot spot location for the icon, it will be in the center of the icon.

bool startTextDrag (const QString &text, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startNewModuleDrag (const QString &mod, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startModuleDrag (MLABModule *mod, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startFieldDrag (MLABField *field, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startObjectDrag (QObject *object, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startColorDrag (const QColor &color, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startImageDrag (const QPixmap &pixmap, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startImageDrag (const QImage &image, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startFileDrag (const QStringList &files, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
bool startFileDrag (const QString &file, const QPixmap &icon=QPixmap(), int hotSpotX=-1, int hotSpotY=-1)
 
Dialogs


void showInformation (const QString &text, const QString &detail, const QString &title, MLABWidgetControl *parent=nullptr)
 
void showInformation (const QString &text, const QString &title=MEVISLAB_TITLESTRING)
 
void showWarning (const QString &text, const QString &detail, const QString &title, MLABWidgetControl *parent=nullptr)
 
void showWarning (const QString &text, const QString &title=MEVISLAB_TITLESTRING)
 
void showCritical (const QString &text, const QString &detail, const QString &title, MLABWidgetControl *parent=nullptr)
 
void showCritical (const QString &text, const QString &title=MEVISLAB_TITLESTRING)
 
int showQuestion (const QString &text, const QString &detail, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber, MLABWidgetControl *parent=nullptr)
 
int showQuestion (const QString &text, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber)
 
int showInformation (const QString &text, const QString &detail, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber, MLABWidgetControl *parent=nullptr)
 
int showInformation (const QString &text, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber)
 
int showWarning (const QString &text, const QString &detail, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber, MLABWidgetControl *parent=nullptr)
 
int showWarning (const QString &text, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber)
 
int showCritical (const QString &text, const QString &detail, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber, MLABWidgetControl *parent=nullptr)
 
int showCritical (const QString &text, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber)
 
QString getMultiLineText (const QString &text, const QString &title, bool richtext, MLABWidgetControl *parent=nullptr)
 
void showMultiLineText (const QString &text, const QString &title, bool richtext, MLABWidgetControl *parent=nullptr)
 
QColor showColorDialog (const QColor &initialColor=Qt::white, MLABWidgetControl *parent=nullptr)
 
QColor showColorDialog (const QString &initialColor, MLABWidgetControl *parent=nullptr)
 
void about (MLABWidgetControl *parent=nullptr)
 
QString aboutThirdPartyHTML ()
 
QWidget * IDE ()
 
Misc methods


void copyToPasteboard (const QString &string)
 
QMimeData * newMimeData ()
 
QString intToString (int value, const QString &format)
 
QString doubleToString (double value, const QString &format)
 
QString stringToEncodedUrlString (const QString &string)
 
QString dateToString (QDateTime date, const QString &format)
 
QString translate (const QByteArray &context, const QString &sourceText, const QString &disambiguation=QString()) const
 
QString escapeString (const QString &value)
 
QString readWindowsRegistry (const QString &type, const QString &key, const QString &subkey)
 
QStringList getProgramFromWindowsRegistry (const QString &type, const QString &key, const QString &subkey)
 
bool valueIsTrue (const QString &val)
 
MLABFieldlastClickedOutputField ()
 
bool hasFeature (const QString &feature)
 
QString licenseFileName ()
 
QStringList prefsFileNames ()
 
QString userPrefsFileName ()
 
void help ()
 
void help (QObject *o)
 
void help (const QString &name)
 
QString cryptString (const QString &data, const QString &password=QString())
 
QString decryptString (const QString &data, const QString &password=QString())
 
QString cryptStringUTF8 (const QString &data, const QString &password=QString())
 
QString decryptStringUTF8 (const QString &data, const QString &password=QString())
 
QString hashStringMD5 (const QString &data)
 
QString hashStringMD5Latin1 (const QString &data)
 
bool qobjectInherits (QObject *object, const QString &classname)
 
MLABScriptRecentFilesHandler * createRecentFilesHandler (MLABWidgetControl *parent, unsigned int maxEntries=20)
 
MeVisLab module introspection.


QStringList modules ()
 
QStringList macroModules ()
 
QStringList mlModules ()
 
QStringList inventorModules ()
 
QStringList allModulesForPackageIdentifier (const QString &packageIdentifier)
 
QMap< QString, QVariant > moduleInfo (const QString &module)
 
QMap< QString, QVariant > getFileFormatLoader (const QString &filename)
 
QStringList findModuleGroups ()
 
QStringList allModules ()
 
QStringList allMacroModules ()
 
QStringList allMLModules ()
 
QStringList allInventorModules ()
 
QVariantMap getModuleDependencies (const QStringList &moduleNames, bool includeModuleDirectories=true, QStringList ignoredPackages=QStringList()<< "MeVis/ThirdParty", bool includeWebContents=false, bool includeModuleHelpFiles=false, MLABNetwork *scannedNetwork=nullptr)
 
MLABModuleDependencyWrapper * getModuleDependency (const QStringList &moduleNames, bool includeModuleDirectories=true, bool includeWebContents=false, bool includeModuleHelpFiles=false, MLABNetwork *scannedNetwork=nullptr)
 
MLABModuleDependencyWrapper * getTestCaseDependency (const QStringList &packages, const QStringList &modulesToExclude, bool includeModuleDirectories=true, bool includeWebContents=false, bool includeModuleHelpFiles=false, MLABNetwork *scannedNetwork=nullptr)
 
QString moduleLiteral (const QString &name)
 
MDL (MeVisLab Definition Language) parsing.


MLABTreereadTreeFromString (const QString &str, bool replaceVars)
 
MLABTreereadTreeFromFile (const QString &filename, bool replaceVars)
 
bool setMDLTagValue (const QString &fileName, const QStringList &treePath, const QString &value)
 
bool writeTreeToFile (MLABTree *tree, const QString &filename)
 
QString writeTreeToString (MLABTree *tree)
 
MLABTreenewTree ()
 
MLABTreenewTree (const QString &name, const QString &value)
 
MLABTreeValidatornewTreeValidator (MLABTree *validatorDefinition)
 
void deleteTreeValidator (MLABTreeValidator *treeValidator)
 
MLABTreeValidatormdlValidator ()
 
bool runMDLValidatorOnTree (MLABTree *tree)
 
QString replaceMDLVariables (const QString &text, const QString &localPath=QString())
 
Reading DICOM files, deprecated and moved to MLABDicom.


MLABMutableDicomTreeloadDicomTree (const QString &filename, LoadDicomTreeOptions options=DicomNoOptions)
 
QString createDicomUid ()
 
Running MeVisLab macro modules as applications.


MLABApplicationRunnerrunApplication (const QString &name)
 
MLABApplicationRunnerrunApplication (const QString &name, const QStringList &args)
 
MLABApplicationRunnerrunApplication (const QString &name, const QStringList &args, MLABWidgetControl *parent)
 
Sign files.


bool isLicenseValid (const QString &license=QString())
 
QStringList getTickets (const QString &license=QString())
 
bool canSignFiles (const QString &license=QString())
 
bool signFilesRecursive (const QString &path, const QString &filter, bool crypt)
 
bool signFilesRecursive (const QString &path, const QString &filter, bool crypt, const QString &license)
 
bool signFiles (const QStringList &files, const QString &filter, bool crypt)
 
bool signFiles (const QStringList &files, const QString &filter, bool crypt, const QString &license)
 
Script extensions.


bool hasScriptExtension (const QString &extension)
 
QObject * getScriptExtension (const QString &extension)
 
QObject * createMLBaseObject (const QString &baseClassName, const QVariantList &arguments=QVariantList())
 
SoFieldContainer * createInventorObject (const QString &className)
 
MLABModulegetModuleForInventorObject (SoFieldContainer *object)
 
SQL databases


MLABScriptSqlDatabase * addSqlDatabase (const QString &type)
 
void removeSqlDatabase (MLABScriptSqlDatabase *db)
 

Properties

int MEVISLAB_VERSION
 
QString MEVISLAB_VERSION_STRING
 
MLABMLScriptWrapperML
 

Detailed Description

Access to all global functions and objects of MLAB.

An instance of this class is available as global "MLAB" object in scripting.

Member Enumeration Documentation

◆ LoadDicomTreeOptions

Options for loadDicomTree, can be or'ed together.

Enumerator
DicomNoOptions 

No extra options.

DicomReadPixelData 

Load pixel data.

DicomReadPrivateTags 

Load private tags.

Member Function Documentation

◆ about

void MLAB::about ( MLABWidgetControl parent = nullptr)
slot

Show the "about" screen.

◆ aboutThirdPartyHTML

QString MLAB::aboutThirdPartyHTML ( )
slot

Return information about used third-party libraries as HTML text, which can be used in the about box of own applications.

◆ addSqlDatabase

MLABScriptSqlDatabase* MLAB::addSqlDatabase ( const QString &  type)
slot

Adds a new database connection of type (where type can be "sqlite", "postgres", or "odbc").

Example:

db = MLAB.addSqlDatabase("postgres")
db.setUserName("myuser")
db.setPassword("mypassword")
db.setDatabaseName("mydatabase")
db.setHostName("myhost.mevis.de")
# optional port, default port is used otherwise
#db.setPort(123412);
# open the database connection
if db.open():
pass # OK
else:
# print error
MLAB.log(db.lastError()["message"])
Access to all global functions and objects of MLAB.
Definition: mlabGlobalScriptAccess.h:81
MLABScriptSqlDatabase * addSqlDatabase(const QString &type)
Adds a new database connection of type (where type can be "sqlite", "postgres", or "odbc").

◆ allInventorModules

QStringList MLAB::allInventorModules ( )
slot

Returns all known Inventor modules (even when not visible to the user).

◆ allMacroModules

QStringList MLAB::allMacroModules ( )
slot

Returns all known macro modules (even when not visible to the user).

◆ allMLModules

QStringList MLAB::allMLModules ( )
slot

Returns all known ML modules (even when not visible to the user).

◆ allModules

QStringList MLAB::allModules ( )
slot

Returns all known modules (even when not visible to the user).

◆ allModulesForPackageIdentifier

QStringList MLAB::allModulesForPackageIdentifier ( const QString &  packageIdentifier)
slot

Returns all modules contained in the specified package.

The package needs to be specified by "PackageGroup/Package", e.g., "MeVisLab/Standard".

◆ buildDate

QDateTime MLAB::buildDate ( )
slot

Returns the build date of MeVisLab.

◆ canSignFiles

bool MLAB::canSignFiles ( const QString &  license = QString())
slot

Return if the given license file (or the currently used license if none was given) can sign files.

◆ clearMLCache

void MLAB::clearMLCache ( )
slot

Clears the complete ML Cache.

◆ compilerInfo

QString MLAB::compilerInfo ( )
slot

Returns information about the used compiler.

◆ computerModelInfo

QString MLAB::computerModelInfo ( )
slot

Returns information about the computer model (e.g., for diagnostic purposes).

◆ copyToPasteboard

void MLAB::copyToPasteboard ( const QString &  string)
slot

Copies a string to the pasteboard.

◆ createDicomUid

QString MLAB::createDicomUid ( )
slot

Please use MLABDicom.createDicomUid() instead of this method.

◆ createHyperLink

QString MLAB::createHyperLink ( const QString &  absfile)
slot

Creates a hyper link string with file part.

◆ createHyperLinkFullPath

QString MLAB::createHyperLinkFullPath ( const QString &  absfile)
slot

Creates a hyper link string with full path.

◆ createHyperLinkWithLine

QString MLAB::createHyperLinkWithLine ( const QString &  absfile,
long  lineno 
)
slot

Creates a hyper link string with line number.

◆ createInventorObject

SoFieldContainer* MLAB::createInventorObject ( const QString &  className)
slot

Creates a new Inventor node or engine.

MeVisLab will load the DLL in which the object is registered if there is an InventorModule with that name. No MLABModule is created, the returned object is the pure OpenInventor node/engine.

◆ createMLBaseObject

QObject* MLAB::createMLBaseObject ( const QString &  baseClassName,
const QVariantList &  arguments = QVariantList() 
)
slot

Creates a new reference-counted ml::Base object, conveniently wrapped for scripting; which arguments must be supplied to this method depends on the Base class.

This method only works for classes derived from ml::RefCountedBase, such as ml::WEM or ml::CSOList, for instance.

◆ createRecentFilesHandler

MLABScriptRecentFilesHandler* MLAB::createRecentFilesHandler ( MLABWidgetControl parent,
unsigned int  maxEntries = 20 
)
slot

Creates a recent file handler.

◆ cryptString

QString MLAB::cryptString ( const QString &  data,
const QString &  password = QString() 
)
slot

Crypts the given string and encodes it into base64 string.

The encoding is Latin-1. If password is not given, an internal default password is used. Please prefer cryptStringUTF8() because it can transport any unicode string.

◆ cryptStringUTF8

QString MLAB::cryptStringUTF8 ( const QString &  data,
const QString &  password = QString() 
)
slot

Crypts the given string and encodes it into base64 string. The encoding is UTF-8. If password is not given, an internal default password is used.

◆ cursorPos

QPoint MLAB::cursorPos ( )
slot

Returns the global cursor position.

◆ dateOfBuildJob

QDateTime MLAB::dateOfBuildJob ( )
slot

Returns the date of the build job in which the MeVisLab installer was build.

it returns the same as buildDate().

◆ dateToString

QString MLAB::dateToString ( QDateTime  date,
const QString &  format 
)
slot

Converts a date to string with the given format.

TODO: explain format in more detail Examples: dd.MM.yyyy 21.05.2001 ddd MMMM d yy Tue May 21 01 hh:mm:ss.zzz 14:13:09.042 h:m:s ap 2:13:9 pm

◆ decryptString

QString MLAB::decryptString ( const QString &  data,
const QString &  password = QString() 
)
slot

Decrypts the given base64 encoded string and returns a decrypted string, returns an empty string on error.

The encoding is Latin-1. If password is not given, an internal default password is used. Please prefer decryptStringUTF8() because it can transport any unicode string.

◆ decryptStringUTF8

QString MLAB::decryptStringUTF8 ( const QString &  data,
const QString &  password = QString() 
)
slot

Decrypts the given base64 encoded string and returns a decrypted string, returns an empty string on error. The encoding is UTF-8. If password is not given, an internal default password is used.

◆ deletePrinter

void MLAB::deletePrinter ( MLABScriptPrinter *  process)
slot

Deletes an MLABPrinter object.

◆ deleteProcess

void MLAB::deleteProcess ( MLABScriptProcess *  process)
slot

sDelete a MLABProcess object (does NOT kill a started process, use kill() instead).

◆ deleteTreeValidator

void MLAB::deleteTreeValidator ( MLABTreeValidator treeValidator)
slot

Deletes the given tree validator.

◆ deleteUnreferencedWrappers

void MLAB::deleteUnreferencedWrappers ( )
slot

This method deletes all script wrappers that are no longer referenced in any scripting language.

Unreferenced wrappers are deleted eventually, anyways, but in case you have a tight loop that creates a lot of wrappers that are not kept around, this method can be used to cleanup unreferenced wrappers immediately.

◆ detailedSystemId

QString MLAB::detailedSystemId ( )
slot

Returns the current system identification MLAB is running on.

Returns the following string depending on the system mlab is running on:

  • "windows [95|98|Me|NT|2000|XP|7]" (on windows)
  • "macos [10.5.6|unknown] [i386|x86_64|unknown] [(cpu count)]" (on macintosh)
  • "linux [system releaseversion]" (on any linux system, using uname)
  • "unknown" (on any other system)

◆ diagnosticLog

void MLAB::diagnosticLog ( const QString &  text)
slot

Logs the given diagnostic text to the console (diagnostics can be turned off globally).

◆ diagnosticLogHTML

void MLAB::diagnosticLogHTML ( const QString &  text)
slot

Logs the given diagnostic HTML text to the console (diagnostics can be turned off globally).

◆ doubleToString

QString MLAB::doubleToString ( double  value,
const QString &  format 
)
slot

Converts a double to string with given format (format is as in printf, e.g., '%5.4f').

◆ editFile

bool MLAB::editFile ( const QString &  abspath)
slot

Opens the file with an external program (in edit mode).

◆ enableBusyStateIndication

bool MLAB::enableBusyStateIndication ( bool  trueOrFalse)
slot

Allows/Prevents the display of the global wait cursor (or any other system specific mean to indicate the busy state).

It does remove any current indication of busy state if set to false. It only enables the indication if it was enabled beforehand. The function returns the previously set value.

◆ enterModalClickGrabber

MLABWidgetControl* MLAB::enterModalClickGrabber ( )
slot

Enters a global event mode, where MeVisLab catches mouse clicks on controls and returns the control the mouse click happened in (NULL is returned when the user presses the escape key or clicks onto a widget that is not inside of a control).

◆ escapeString

QString MLAB::escapeString ( const QString &  value)
slot

Escapes the given string so that RichText elements in the text are visible as literal text.

The result can safely be logged via the log() function.

◆ exit

void MLAB::exit ( int  code)
slot

Exit MeVisLab the hard way, scripting still goes on after this, its better to use terminate().

◆ findModuleGroups

QStringList MLAB::findModuleGroups ( )
slot

Returns a list of known module groups in the form "group":"number of modules":"names of modules".

◆ getAutomaticFieldTitle

QString MLAB::getAutomaticFieldTitle ( const QString &  name,
bool  splitUppercase 
)
slot

Returns the field name with the components separated by space.

◆ getCacheAndLockedMemorySizeInKB

int MLAB::getCacheAndLockedMemorySizeInKB ( )
slot

Returns the cache and locked memory size of the memory manager in KB.

◆ getCacheAndLockedMemorySizeLimitInKB

int MLAB::getCacheAndLockedMemorySizeLimitInKB ( )
slot

Returns the cache and locked memory size limit of the memory manager in KB.

◆ getenv

QString MLAB::getenv ( const QString &  str)
slot

Returns the value of the environment variable.

◆ getFileFormatLoader

QMap<QString, QVariant> MLAB::getFileFormatLoader ( const QString &  filename)
slot

Returns the file format loader for the extension of the given filename.

If a loader exists, this method returns a map with the following keys:

  • module : the module that can handle the extension
  • filenameField : the field that should be set with the filename

If no loader exists, the map is empty.

◆ getModuleDependencies

QVariantMap MLAB::getModuleDependencies ( const QStringList &  moduleNames,
bool  includeModuleDirectories = true,
QStringList  ignoredPackages = QStringList()<< "MeVis/ThirdParty",
bool  includeWebContents = false,
bool  includeModuleHelpFiles = false,
MLABNetwork scannedNetwork = nullptr 
)
slot

Returns a dictionary containing all files and directories on which the given macro modules depend.

The dictionary contains string lists for the keys:

  • "dirs"
  • "dlls"
  • "files"
  • "modules"
  • "scriptFiles"
    Parameters
    moduleNamesThe names of the modules to analyze.
    includeModuleDirectoriesspecifies whether the directories in which the module definitions exist are included
    ignoredPackagescan be specified to ignore dependencies from certain packages
    includeWebContentscan be specified to include web contents
    includeModuleHelpFilescan be specified to include help contents
    scannedNetworkthe network that is scanned (mainly to get the network path)

◆ getModuleDependency

MLABModuleDependencyWrapper* MLAB::getModuleDependency ( const QStringList &  moduleNames,
bool  includeModuleDirectories = true,
bool  includeWebContents = false,
bool  includeModuleHelpFiles = false,
MLABNetwork scannedNetwork = nullptr 
)
slot

Returns an MLABModuleDependency object for accessing the dependency data.

◆ getModuleForInventorObject

MLABModule* MLAB::getModuleForInventorObject ( SoFieldContainer *  object)
slot

Returns the MLABModule for a C++ Open Inventor node/engine.

If the node/engine has no associated MLABInventorModule, NULL is returned.

◆ getMultiLineText

QString MLAB::getMultiLineText ( const QString &  text,
const QString &  title,
bool  richtext,
MLABWidgetControl parent = nullptr 
)
slot

Ask for a multi line requester which returns the text.

◆ getNumberOfImageProcessingThreads

int MLAB::getNumberOfImageProcessingThreads ( )
slot

Returns the number of parallel worker threads that the ML host is allowed to use.

This calls ml::Host::getMaxNumThreads() on the C++ layer.

◆ getProgramFromWindowsRegistry

QStringList MLAB::getProgramFromWindowsRegistry ( const QString &  type,
const QString &  key,
const QString &  subkey 
)
slot

Reads the windows key, where type may be one of CLASSES_ROOT, LOCAL_MACHINE, CURRENT_USER, USERS, and returns a list of strings where the first string is the program name and the remaining strings are arguments.

If the list is empty, no program was found. The returned list items do not contain any quotes.

◆ getScriptExtension

QObject* MLAB::getScriptExtension ( const QString &  extension)
slot

Returns access to the given script extension.

◆ getSpellingCorrectionSuggestions

QStringList MLAB::getSpellingCorrectionSuggestions ( const QString &  word)
slot

Checks spelling and returns a list of suggestions if the given word has not been recognized.

◆ getTestCaseDependency

MLABModuleDependencyWrapper* MLAB::getTestCaseDependency ( const QStringList &  packages,
const QStringList &  modulesToExclude,
bool  includeModuleDirectories = true,
bool  includeWebContents = false,
bool  includeModuleHelpFiles = false,
MLABNetwork scannedNetwork = nullptr 
)
slot

Returns an MLABModuleDependency object for accessing the dependency data of the test cases in the given packages.

◆ getTickets

QStringList MLAB::getTickets ( const QString &  license = QString())
slot

Return tickets of the given license file (or of the currently used license if none was given)

◆ hasFeature

bool MLAB::hasFeature ( const QString &  feature)
slot

Returns whether license has a given feature.

◆ hashStringMD5

QString MLAB::hashStringMD5 ( const QString &  data)
slot

Returns the md5 hash string for the given data string (converted from Unicode to UTF8).

◆ hashStringMD5Latin1

QString MLAB::hashStringMD5Latin1 ( const QString &  data)
slot

Returns the md5 hash string for the given data string (converted from Unicode to Latin1).

◆ hasScriptExtension

bool MLAB::hasScriptExtension ( const QString &  extension)
slot

Returns whether the given script extension is defined. The method doesn't try to load it.

◆ hasVariable

bool MLAB::hasVariable ( const QString &  name)
slot

Returns whether a global pref variable exists (from MeVisLab prefs and registry).

◆ help [1/3]

void MLAB::help ( )
slot

Gives scripting help for the MLAB object itself.

◆ help [2/3]

void MLAB::help ( const QString &  name)
slot

Gives scripting help for the given class name (if available).

◆ help [3/3]

void MLAB::help ( QObject *  o)
slot

Gives scripting help for the given object (if available).

◆ IDE

QWidget* MLAB::IDE ( )
slot

Returns access to the IDE, especially for User Scripts.

◆ indicateBusyState

void MLAB::indicateBusyState ( const QString &  message = QString())
slot

Shows the global wait cursor (be sure to call removeBusyStateIndicator the same number of times as indicateBusyState).

A message may be given to indicate a reason.

This method shows a cursor that indicates that no interaction is possible. If you need to indicate a busy state while interaction is still possible, please use Qt directly:

from PythonQt.QtGui import QGuiApplication, QCursor
from PythonQt.QtCore import Qt
...
QGuiApplication.setOverrideCursor(QCursor(Qt.BusyCursor))
...
QGuiApplication.restoreOverrideCursor()

Referenced by setWaitCursor().

◆ intToString

QString MLAB::intToString ( int  value,
const QString &  format 
)
slot

Converts an integer to string with given format (format is as in printf, e.g., 'x').

◆ inventorModules

QStringList MLAB::inventorModules ( )
slot

Returns all known inventor modules (that are visible to the user).

◆ isDebug

bool MLAB::isDebug ( )
slot

Returns whether MLAB is compiled in debug mode (release mode otherwise).

◆ isLicenseValid

bool MLAB::isLicenseValid ( const QString &  license = QString())
slot

Return if the given license file (or the currently used license if none was given) is currently valid.

◆ isLinux

bool MLAB::isLinux ( )
slot

Returns whether system is Linux.

◆ isMacOS

bool MLAB::isMacOS ( )
slot

Returns whether system is Mac OS X.

◆ isModuleProfilingEnabled

bool MLAB::isModuleProfilingEnabled ( )
slot

Returns whether module profiling is enabled.

◆ isSpelledCorrectly

bool MLAB::isSpelledCorrectly ( const QString &  word)
slot

Returns whether the spelling of the given word is correct.

◆ isStandaloneApplication

bool MLAB::isStandaloneApplication ( )
slot

Returns whether MeVisLab runs a macro as standalone application.

◆ isUnix

bool MLAB::isUnix ( )
slot

Returns whether system is Linux or Mac OS X.

◆ isWindows

bool MLAB::isWindows ( )
slot

Returns whether system is Windows.

◆ lastClickedOutputField

MLABField* MLAB::lastClickedOutputField ( )
slot

Returns last clicked output field in an MeVislab network (might be NULL).

◆ licenseFileName

QString MLAB::licenseFileName ( )
slot

Returns the absolute path to the license that MeVisLab is currently using.

◆ loadDicomTree

MLABMutableDicomTree* MLAB::loadDicomTree ( const QString &  filename,
LoadDicomTreeOptions  options = DicomNoOptions 
)
slot

Please use MLABDicom.loadDicomTree() instead of this method.

◆ loadLibrary

bool MLAB::loadLibrary ( const QString &  libraryName)
slot

Loads the given library and returns whether the loading succeeded.

The name should not contain a debug postfix, not a platform specific prefix/ending, this is added automatically. If a library was already loaded successfully before, it will not be loaded again and this method will return true.

◆ log

void MLAB::log ( const QString &  text)
slot

Logs the given text to the console.

◆ logError

void MLAB::logError ( const QString &  text)
slot

Log an error to the console.

◆ logErrorHTML

void MLAB::logErrorHTML ( const QString &  text)
slot

Logs an error to the console (using HTML).

◆ logFixed

void MLAB::logFixed ( const QString &  text)
slot

Logs the given text to the console, using a fixed size font and replacing spaces with  .

◆ logHTML

void MLAB::logHTML ( const QString &  text)
slot

Logs the given text to the console (using HTML).

◆ logWarning

void MLAB::logWarning ( const QString &  text)
slot

Logs a warning to the console.

◆ logWarningHTML

void MLAB::logWarningHTML ( const QString &  text)
slot

Logs a warning to the console (using HTML).

◆ macIsApplicationRunning

bool MLAB::macIsApplicationRunning ( const QString &  bundleId)
slot

Returns whether a specific application specified by its bundle id is already running (Mac OS X only).

◆ macOpenFileInApplication

bool MLAB::macOpenFileInApplication ( const QString &  filePath,
const QString &  bundleId 
)
slot

Specifies the bundle identifier for the application to use for opening the file (Mac OS X only).

◆ macroModules

QStringList MLAB::macroModules ( )
slot

Returns all known macro modules (that are visible to the user).

◆ mdlControlAtCurrentCursorPosition

MLABWidgetControl* MLAB::mdlControlAtCurrentCursorPosition ( )
slot

Returns the MDL control that is located at the current cursor position (or NULL if there is none).

◆ mdlControlAtGlobalPosition [1/2]

MLABWidgetControl* MLAB::mdlControlAtGlobalPosition ( const QPoint &  globalPosition)
slot

Returns the MDL control that is located at the given global screen position (or NULL if there is none).

◆ mdlControlAtGlobalPosition [2/2]

MLABWidgetControl* MLAB::mdlControlAtGlobalPosition ( int  x,
int  y 
)
slot

Returns the MDL control that is located at the given global screen position (or NULL if there is none).

◆ mdlValidator

MLABTreeValidator* MLAB::mdlValidator ( )
slot

Returns the MDL validator (used for module scripts / MDL GUI), the ownership stays with MeVisLab.

◆ mlModules

QStringList MLAB::mlModules ( )
slot

Returns all known ML modules (that are visible to the user).

◆ moduleInfo

QMap<QString, QVariant> MLAB::moduleInfo ( const QString &  module)
slot

Returns info for the given module; the returned array contains the tag=value keys from the module definition.

The module type is given as type=[MLModule|InventorModule|MacroModule]. The module name is given as name=NAME. The module package is given package=PACKAGENAME. The module filename+linenumber are given as file=abspath lineno=4711 If module is not found, the array is empty.

◆ moduleLiteral

QString MLAB::moduleLiteral ( const QString &  name)
inlineslot

Does nothing but return the module name.

This function is used to indicate that the given string is a module name. The ModuleDependencyAnalyzer will then know that it has to include the given module. Note: do not pass a variable to this method, because then the ModuleDependencyAnalyzer cannot detect the dependency.

◆ modules

QStringList MLAB::modules ( )
slot

Returns all known modules (that are visible to the user).

◆ msleep

void MLAB::msleep ( int  msecs)
slot

Causes MLAB to sleep msecs milli seconds.

◆ newHttpDownload

MLABHttpDownload* MLAB::newHttpDownload ( )
slot

Creates a new HTTP download object (which is automatically garbage collected).

◆ newMimeData

QMimeData* MLAB::newMimeData ( )
slot

Creates a new mime data object that is owned by C++ and will not be deleted by PythonQt.

◆ newPrinter

MLABScriptPrinter* MLAB::newPrinter ( )
slot

Creates a new process, see MLABPrinter class for its API.

You have to delete the returned pointer later on with deletePrinter!

◆ newProcess

MLABScriptProcess* MLAB::newProcess ( )
slot

Creates a new process, see MLABProcess class for its API.

You have to delete the returned pointer later on with deleteProcess!

◆ newTree [1/2]

MLABTree* MLAB::newTree ( )
slot

Creates and returns a new tree element.

◆ newTree [2/2]

MLABTree* MLAB::newTree ( const QString &  name,
const QString &  value 
)
slot

Creates and returns a new tree element.

◆ newTreeValidator

MLABTreeValidator* MLAB::newTreeValidator ( MLABTree validatorDefinition)
slot

Create and returns a new tree validator from the given MDL validator definition.

◆ openFile

bool MLAB::openFile ( const QString &  abspath,
int  lineno = -1 
)
slot

Opens the file with an external program (in open mode).

◆ openUrl

bool MLAB::openUrl ( const QString &  abspath)
slot

Opens the given URL with an external program.

◆ prefsFileNames

QStringList MLAB::prefsFileNames ( )
slot

Return all file names used for preferences setup.

◆ processEvents [1/2]

void MLAB::processEvents ( )
slot

Processes events (user events are filtered, just redrawing and timers are processed).

◆ processEvents [2/2]

void MLAB::processEvents ( bool  allowUserInput)
slot

Processes events.

If user input is allowed be careful with side effects, since the user can e.g. press a button and execute another script etc.

◆ processInventorQueue

void MLAB::processInventorQueue ( )
slot

Processes the delay queue of OpenInventor.

This is needed if you want to make sure that all pending OpenInventor notifications are processed.

◆ qobjectInherits

bool MLAB::qobjectInherits ( QObject *  object,
const QString &  classname 
)
slot

Returns whether the given QObject inherits from the given classname.

◆ readKey

QString MLAB::readKey ( const QString &  application,
const QString &  key 
)
slot

Reads an application specific key for its value, e.g., "ILabNeuro", "FileDialogPath".

This method can be used to easily store machine/user dependent settings in the registry. Returns an empty string if the key is not set.

◆ readTreeFromFile

MLABTree* MLAB::readTreeFromFile ( const QString &  filename,
bool  replaceVars 
)
slot

Parses the given MDL file, returns an empty tree on error.

◆ readTreeFromString

MLABTree* MLAB::readTreeFromString ( const QString &  str,
bool  replaceVars 
)
slot

Parses the given MDL file, returns an empty tree on error.

◆ readWindowsRegistry

QString MLAB::readWindowsRegistry ( const QString &  type,
const QString &  key,
const QString &  subkey 
)
slot

Reads the windows key, type may be one of CLASSES_ROOT, LOCAL_MACHINE, CURRENT_USER, USERS.

◆ removeBusyStateIndicator

void MLAB::removeBusyStateIndicator ( )
slot

Removes the global wait cursor.

Referenced by removeWaitCursor().

◆ removeOverrideCursor

void MLAB::removeOverrideCursor ( )
slot

Removes the last override cursor.

◆ removeSqlDatabase

void MLAB::removeSqlDatabase ( MLABScriptSqlDatabase *  db)
slot

Remove the given database.

◆ removeWaitCursor

void MLAB::removeWaitCursor ( )
inlineslot

◆ replaceMDLVariables

QString MLAB::replaceMDLVariables ( const QString &  text,
const QString &  localPath = QString() 
)
slot

Replaces MDL variables in a given string and returns it.

◆ runActionOnFile

bool MLAB::runActionOnFile ( const QString &  action,
const QString &  abspath 
)
slot

Runs the given abstract action on given absolute file path (this does the same as opening files in MeVisLab, e.g., it can "open" .mlab files, .def files, etc.).

The command executed by the given action depends on the settings in your mevislab.prefs file. On Windows, the default behavior is using ShellExecute(), so the command is the same as clicking "open", "edit", "explore", etc. on the file in the Explorer.

Available commands:

  • "open" opens a file
  • "edit" opens a file for editing (e.g., for HTML there is a difference in opening for viewing and for editing)
  • "explore" opens a directory explorer
  • "windowsDefault" does the default action (like double clicking on a file in explorer) WINDOWS ONLY!

◆ runApplication [1/3]

MLABApplicationRunner* MLAB::runApplication ( const QString &  name)
slot

Runs a macro module as an application.

◆ runApplication [2/3]

MLABApplicationRunner* MLAB::runApplication ( const QString &  name,
const QStringList &  args 
)
slot

Runs the application given by name.

The arguments are given as an array of strings. All arguments are optional. Possible entries are:

  • "name" "WINDOWNAME" - run a named window instead of the default window of the module
  • "style" "STYLENAME" - root style to use, e.g., Application, Panel, or custom style
  • "noshow" - don't show the window of the application
  • "fullscreen" - show the window fullscreen without window bar
  • "maximized" - run in fullscreen mode (not when modal!)
  • "childwindow" - run as child window of MeVisLab (or of the passes application window as parent, see next method)
  • "modal" - run as a modal dialog
  • "popup" - show the application as a popup window

◆ runApplication [3/3]

MLABApplicationRunner* MLAB::runApplication ( const QString &  name,
const QStringList &  args,
MLABWidgetControl parent 
)
slot

Like above but with a given parent application window.

◆ runCommand

bool MLAB::runCommand ( const QString &  command,
const QStringList &  arguments = QStringList(),
const QString &  workingDir = QString() 
)
slot

Run the given executable command with given arguments array and return whether it was successful.

Parameters
commandexecutable, may be absolute path or local in PATH environment
argumentslist of arguments passed to command
workingDirworking directory passed to command
Returns
returns true if successful

This command runs synchronously, so the command was definitely executed when this function returns. If you need more control on the command, use the MLABProcess class instead.

◆ runCommandDetached

bool MLAB::runCommandDetached ( const QString &  command,
const QStringList &  arguments = QStringList(),
const QString &  workingDirectory = QString(),
bool  makeFrontmost = true 
)
slot

Runs the given executable command with given arguments array in a new process and detach from it.

Returns whether launch has been successful.

Parameters
commandexecutable, may be absolute path or local in PATH environment
argumentslist of arguments passed to command (can be empty list)
workingDirectorycommand will be started in this directory (uses current directory if none is given)
makeFrontmostmake application front most on Mac OS X if set 'true' (default)
Returns
returns true if successful

◆ runCommandInConsole

bool MLAB::runCommandInConsole ( const QString &  command,
const QStringList &  arguments = QStringList(),
const QString &  workingDir = QString(),
const QString &  standardIn = QString(),
const QString &  title = QString(),
MLABWidgetControl parent = nullptr,
bool  waitUntilFinished = false 
)
slot

Runs the given command in a console window.

This method returns immediately, stdout+stderr are going to the console. The window must be closed by the user. If an error occurres the processError(QProcess*,QProcess::ProcessError) signal is emitted.

example:

MLAB.runCommandInConsole("eatDicom", ["-help"], "", "", "Running eatDicom")
bool runCommandInConsole(const QString &command, const QStringList &arguments=QStringList(), const QString &workingDir=QString(), const QString &standardIn=QString(), const QString &title=QString(), MLABWidgetControl *parent=nullptr, bool waitUntilFinished=false)
Runs the given command in a console window.

◆ runCommandStdInOut

QMap<QString, QVariant> MLAB::runCommandStdInOut ( const QString &  command,
const QStringList &  arguments = QStringList(),
const QString &  workingDir = QString(),
const QString &  standardIn = QString() 
)
slot

Runs the given command, passing additional stdin text and returning a map with the result and the stdout.

This command runs synchronously. The result is a map that contains:

  • ok (true if call succeeded)
  • status (exit status if call succeeded)
  • stdout (stdoutput of the started process)
  • stderr (stderror of the started process)
  • error (error code if call failed, doesn't exist otherwise)

Example:

result = MLAB.runCommandStdInOut("cat",[""],"","test data...")
if result["ok"]:
MLAB.log("result: " + str(result["status"]) + " " + result["stdout"] + " " + result["stderr"])
QMap< QString, QVariant > runCommandStdInOut(const QString &command, const QStringList &arguments=QStringList(), const QString &workingDir=QString(), const QString &standardIn=QString())
Runs the given command, passing additional stdin text and returning a map with the result and the std...
void log(const QString &text)
Logs the given text to the console.

◆ runMDLValidatorOnTree

bool MLAB::runMDLValidatorOnTree ( MLABTree tree)
slot

Runs the MDL validator on the given tree and returns whether the tree was valid.

◆ setDontExitAfterConsoleCommand

void MLAB::setDontExitAfterConsoleCommand ( bool  dontExitAfterConsoleCommand)
slot

Sets whether MeVisLab will exit (and thus stop the Qt event loop) after the consoleCommand/runApplicationCommand has finished.

◆ setHighPrecisionLoggingTimeStampsEnabled

bool MLAB::setHighPrecisionLoggingTimeStampsEnabled ( bool  enabled)
slot

Enables high precision timestamps for log messages that include microseconds.

Returns if the logging time stamps were enabled or disabled previously.

◆ setMDLTagValue

bool MLAB::setMDLTagValue ( const QString &  fileName,
const QStringList &  treePath,
const QString &  value 
)
slot

Sets the value of an MDL tag in the given MDL file.

The tree path resembles the tree hierarchy of the tag. The first tag whose hierarchy matches the tree path will be modified. For example, a tree path can look like Window::windowName > Vertical > Field::fieldName > dependsOn.

Parameters
fileNameThe filename.
treePathList of tree names, and optionally values append to the tag name after a '#', that resembles the target tree hierarchy.
valueThe new value for the MDL tag.
Returns
Returns true on success, false otherwise.

◆ setModuleProfilingEnabled

void MLAB::setModuleProfilingEnabled ( bool  enabled)
slot

Sets whether module profiling is enabled.

◆ setNumberOfImageProcessingThreads

int MLAB::setNumberOfImageProcessingThreads ( int  numThreads)
slot

Sets the number of parallel worker threads that the ML host is allowed to use.

It returns the previous value. This calls ml::Host::setMaxNumThreads() on the C++ layer.

◆ setOverrideCursor [1/3]

void MLAB::setOverrideCursor ( const QPixmap &  pixmap)
slot

Sets the global override cursor to the given pixmap.

◆ setOverrideCursor [2/3]

void MLAB::setOverrideCursor ( const QString &  filename)
slot

Sets the global override cursor to the given pixmap file.

◆ setOverrideCursor [3/3]

void MLAB::setOverrideCursor ( const QString &  filename,
int  hotspotx,
int  hotspoty 
)
slot

Sets the global override cursor to the given pixmap file and sets the hot spot within that pixmap.

◆ setShouldStop

void MLAB::setShouldStop ( )
slot

Set the global should stop flag, this can be used to debug/test Python code that runs in in a shouldStop() loop.

◆ setVariable

void MLAB::setVariable ( const QString &  name,
const QString &  value 
)
slot

Sets the value of a global pref variable (only transient, will be default on next restart).

◆ setWaitCursor

void MLAB::setWaitCursor ( )
inlineslot

References indicateBusyState().

◆ shouldStop

bool MLAB::shouldStop ( )
slot

Global break checking which can be called from the scripting to allow pressing buttons which have the globalStop tag set to true.

Returns
returns true if a stop button was pressed

◆ showColorDialog [1/2]

QColor MLAB::showColorDialog ( const QColor &  initialColor = Qt::white,
MLABWidgetControl parent = nullptr 
)
slot

Returns a QColor from a color dialog.

◆ showColorDialog [2/2]

QColor MLAB::showColorDialog ( const QString &  initialColor,
MLABWidgetControl parent = nullptr 
)
slot

Returns a QColor from a color dialog, initialColor is given as a name (e.g., "white") or in hexadecimal notation (e.g., "#44cc88").

◆ showCritical [1/4]

int MLAB::showCritical ( const QString &  text,
const QString &  detail,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber,
MLABWidgetControl parent = nullptr 
)
slot

Shows a critical error panel with given parameters, for details see showQuestion(), defaultButtonNumber gives the default button starting from 0.

◆ showCritical [2/4]

void MLAB::showCritical ( const QString &  text,
const QString &  detail,
const QString &  title,
MLABWidgetControl parent = nullptr 
)
slot

Shows a critical message box with graphically separated details and OK button.

◆ showCritical [3/4]

int MLAB::showCritical ( const QString &  text,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber 
)
slot

Shows a critical error panel with given parameters, for details see showQuestion(), defaultButtonNumber gives the default button starting from 0.

◆ showCritical [4/4]

void MLAB::showCritical ( const QString &  text,
const QString &  title = MEVISLAB_TITLESTRING 
)
slot

Shows a critical message box with OK button.

◆ showInformation [1/4]

int MLAB::showInformation ( const QString &  text,
const QString &  detail,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber,
MLABWidgetControl parent = nullptr 
)
slot

Shows an information panel with given parameters, for details see showQuestion(), defaultButtonNumber gives the default button starting from 0.

◆ showInformation [2/4]

void MLAB::showInformation ( const QString &  text,
const QString &  detail,
const QString &  title,
MLABWidgetControl parent = nullptr 
)
slot

Shows an information message box with graphically separated details and OK button.

◆ showInformation [3/4]

int MLAB::showInformation ( const QString &  text,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber 
)
slot

Shows an information panel with given parameters, for details see showQuestion(), defaultButtonNumber gives the default button starting from 0.

◆ showInformation [4/4]

void MLAB::showInformation ( const QString &  text,
const QString &  title = MEVISLAB_TITLESTRING 
)
slot

Shows an information message box with OK button.

◆ showMultiLineText

void MLAB::showMultiLineText ( const QString &  text,
const QString &  title,
bool  richtext,
MLABWidgetControl parent = nullptr 
)
slot

Shows a window with multi line text.

◆ showQuestion [1/2]

int MLAB::showQuestion ( const QString &  text,
const QString &  detail,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber,
MLABWidgetControl parent = nullptr 
)
slot

Shows a question panel with given parameters.

Returns
number of pressed button, starting with 0
Parameters
texttext to show
detaildetailed information to show (e.g. a file or directory name)
titlewindow title to show
buttonTextslist of button texts to show on the buttons, e.g., ["Ok", "Cancel"] or ["Retry", "Abort", "Ignore"]. Please use the following standard button texts if at all possible (ensures display of buttons in right order on any platform / ESC detection): Ok, Open, Save, Cancel, Close, Discard, Apply, Reset, Restore Defaults, Help, Save All, Yes, Yes To All, No, No To All, Abort, Retry, Ignore
defaultButtonNumberbutton that is used when user presses return, starting from 0 for the first button
parentparent window, e.g. ctx.window(), the dialog becomes becomes modal relative to parent or application modal if NULL Script example:
i = MLAB.showQuestion("How about some coffee?", "I've got a new espresso machine", "MeVisLab", ["Yes", "No", "Cancel"], 0)
if i == 0:
pass # handle "Yes"
elif i == 1:
pass # handle "No"
elif i == 2:
pass # handle "Cancel" / Pressing of ESC
int showQuestion(const QString &text, const QString &detail, const QString &title, const QStringList &buttonTexts, int defaultButtonNumber, MLABWidgetControl *parent=nullptr)
Shows a question panel with given parameters.

◆ showQuestion [2/2]

int MLAB::showQuestion ( const QString &  text,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber 
)
slot

Shows a question panel with given parameters, defaultButtonNumber gives the default button starting from 0.

◆ showWarning [1/4]

int MLAB::showWarning ( const QString &  text,
const QString &  detail,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber,
MLABWidgetControl parent = nullptr 
)
slot

Shows a warning message panel with given parameters, for details see showQuestion(), defaultButtonNumber gives the default button starting from 0.

◆ showWarning [2/4]

void MLAB::showWarning ( const QString &  text,
const QString &  detail,
const QString &  title,
MLABWidgetControl parent = nullptr 
)
slot

Shows a warning message box with graphically separated details and OK button.

◆ showWarning [3/4]

int MLAB::showWarning ( const QString &  text,
const QString &  title,
const QStringList &  buttonTexts,
int  defaultButtonNumber 
)
slot

Shows a warning message panel with given parameters, for details see showQuestion(), defaultButtonNumber gives the default button starting from 0.

◆ showWarning [4/4]

void MLAB::showWarning ( const QString &  text,
const QString &  title = MEVISLAB_TITLESTRING 
)
slot

Shows a warning message box with OK button.

◆ signFiles [1/2]

bool MLAB::signFiles ( const QStringList &  files,
const QString &  filter,
bool  crypt 
)
slot

Signs the files (absolute filenames) with the license that MeVisLab was started with.

◆ signFiles [2/2]

bool MLAB::signFiles ( const QStringList &  files,
const QString &  filter,
bool  crypt,
const QString &  license 
)
slot

Signs the files (absolute filenames) with the license file given as license.

◆ signFilesRecursive [1/2]

bool MLAB::signFilesRecursive ( const QString &  path,
const QString &  filter,
bool  crypt 
)
slot

Signs the files with the license that MeVisLab was started with.

◆ signFilesRecursive [2/2]

bool MLAB::signFilesRecursive ( const QString &  path,
const QString &  filter,
bool  crypt,
const QString &  license 
)
slot

Signs the files with the license file given as license.

◆ sleep

void MLAB::sleep ( int  secs)
slot

Causes MLAB to sleep secs seconds.

◆ standaloneApplicationName

QString MLAB::standaloneApplicationName ( )
slot

Returns the name of the Macro module that is running as a MeVisLabApp standalone application (or empty string if MeVisLab itself is running).

◆ startObjectDrag

bool MLAB::startObjectDrag ( QObject *  object,
const QPixmap &  icon = QPixmap(),
int  hotSpotX = -1,
int  hotSpotY = -1 
)
slot

Start dragging a QObject.

◆ stringToEncodedUrlString

QString MLAB::stringToEncodedUrlString ( const QString &  string)
slot

Converts a string URL to an encoded URL string (using xx encoding).

◆ systemId

QString MLAB::systemId ( )
slot

Returns the current system identification MLAB is running on/.

Returns the following string depending on the system mlab is running on:

  • windows
  • macos
  • linux
  • unknown (on any other system)

If you want to get specific system information, use systemIdDetail().

◆ systemInfo

QString MLAB::systemInfo ( )
slot

Returns a detailed info string about the system, should not be used for checking purposes, use systemId() or detailedSystemId() instead.

◆ terminate

void MLAB::terminate ( int  exitCode = 0)
slot

Terminates the whole MeVisLab application, note that scripting goes on after this call and MLAB closes in the next event processing.

◆ translate

QString MLAB::translate ( const QByteArray &  context,
const QString &  sourceText,
const QString &  disambiguation = QString() 
) const
slot

Translate a string with Qt's translation infrastructure.

◆ unsetVariable

void MLAB::unsetVariable ( const QString &  name)
slot

Unsets a global pref variable (only transient, will be default on next restart).

◆ userPrefsFileName

QString MLAB::userPrefsFileName ( )
slot

Return file name provided with -prefs parameter.

◆ usleep

void MLAB::usleep ( int  usecs)
slot

Causes MLAB to sleep usecs micro seconds.

◆ valueIsTrue

bool MLAB::valueIsTrue ( const QString &  val)
slot

Returns whether the string value is true in the MeVisLab sense (Yes|1|On|True).

◆ variable

QString MLAB::variable ( const QString &  name)
slot

Returns the value of a global pref variable (read from MeVisLab prefs and registry).

◆ variableIsTrue

bool MLAB::variableIsTrue ( const QString &  name)
slot

Returns whether variable has YES/TRUE/1 as value.

◆ writeKey

void MLAB::writeKey ( const QString &  application,
const QString &  key,
const QString &  value 
)
slot

Write a permanent key/value pair for the given application.

This method can be used to easily retrieve machine/user settings information from the registry. If you want to immediately save you settings, you have to call writeRegistry() after your writeKey() calls.

◆ writeRegistry

void MLAB::writeRegistry ( )
slot

To make sure that settings set via writeKey() are stored immediately, call this method.

◆ writeTreeToFile

bool MLAB::writeTreeToFile ( MLABTree tree,
const QString &  filename 
)
slot

Writes the given tree to a file.

◆ writeTreeToString

QString MLAB::writeTreeToString ( MLABTree tree)
slot

Writes the given tree to a file.

Property Documentation

◆ MEVISLAB_VERSION

int MLAB::MEVISLAB_VERSION
read

The version number of MeVisLab as a number MAJOR_VERSION * 100000 + MINOR_VERSION * 100 + PATCH_LEVEL.

For example MeVisLab version 3.5.0 is represented by the number 300500.

Note
Releases before 3.5 would use MAJOR_VERSION * 100 + MINOR_VERSION (without PATCH_LEVEL).

◆ MEVISLAB_VERSION_STRING

QString MLAB::MEVISLAB_VERSION_STRING
read

The complete version of MeVisLab as a string.

This is the version as shown in the About dialog.

◆ ML

MLABMLScriptWrapper* MLAB::ML
read

Provides access to ML global type functions.