MeVisLab Scripting Reference
|
Inherits QObject.
Public Types | |
enum | LoadDicomTreeOptions { DicomNoOptions = 0, DicomReadPixelData = 1, DicomReadPrivateTags = 2 } |
enum | macAuthorizationError { macErrAuthorizationUnknown = -1, macErrAuthorizationSuccess = 0, macErrAuthorizationCanceled = 1, macErrAuthorizationDenied = 2, macErrAuthorizationToolExecuteFailure = 3, macErrAuthorizationToolEnvironmentError = 4 } |
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 () |
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=NULL) |
QMap< QString, QVariant > | macRunPrivilegedCommand (const QString &command, const QStringList &arguments, const QString &securityEventId=QString(), const QString &prompt=QString()) |
bool | macIsApplicationRunning (const QString &bundleId) |
MLABScriptProcess * | newProcess () |
void | deleteProcess (MLABScriptProcess *process) |
MLABHttpDownload * | newHttpDownload () |
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) |
QString | createHyperLink (const QString &absfile) |
QString | createHyperLinkFullPath (const QString &absfile) |
QString | createHyperLinkWithLine (const QString &absfile, long lineno) |
Event processing | |
void | processInventorQueue () |
bool | shouldStop () |
void | processEvents () |
void | processEvents (bool allowUserInput) |
void | terminate () |
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 () |
MLABWidgetControl * | mdlControlAtCurrentCursorPosition () |
MLABWidgetControl * | mdlControlAtGlobalPosition (const QPoint &globalPosition) |
MLABWidgetControl * | mdlControlAtGlobalPosition (int x, int y) |
void | sleep (int secs) |
void | msleep (int msecs) |
void | usleep (int usecs) |
MLABWidgetControl * | enterModalClickGrabber () |
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=NULL) |
void | showInformation (const QString &text, const QString &title=MEVISLAB_TITLESTRING) |
void | showWarning (const QString &text, const QString &detail, const QString &title, MLABWidgetControl *parent=NULL) |
void | showWarning (const QString &text, const QString &title=MEVISLAB_TITLESTRING) |
void | showCritical (const QString &text, const QString &detail, const QString &title, MLABWidgetControl *parent=NULL) |
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=NULL) |
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=NULL) |
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=NULL) |
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=NULL) |
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=NULL) |
void | showMultiLineText (const QString &text, const QString &title, bool richtext, MLABWidgetControl *parent=NULL) |
QColor | showColorDialog (const QColor &initialColor=Qt::white, MLABWidgetControl *parent=NULL) |
QColor | showColorDialog (const QString &initialColor, MLABWidgetControl *parent=NULL) |
void | about (MLABWidgetControl *parent=NULL) |
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) |
MLABField * | lastClickedOutputField () |
bool | hasFeature (const QString &feature) |
QString | licenseFileName () |
void | help () |
void | help (QObject *o) |
void | help (const QString &name) |
QString | cryptString (const QString &data) |
QString | decryptString (const QString &data) |
QString | cryptString (const QString &data, const QString &password) |
QString | decryptString (const QString &data, const QString &password) |
QString | hashStringMD5 (const QString &data) |
QString | hashStringMD5Latin1 (const QString &data) |
bool | qobjectInherits (QObject *object, const QString &classname) |
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=NULL) |
MLABModuleDependencyWrapper * | getModuleDependency (const QStringList &moduleNames, bool includeModuleDirectories=true, bool includeWebContents=false, bool includeModuleHelpFiles=false, MLABNetwork *scannedNetwork=NULL) |
MDL (MeVisLab Definition Language) parsing. | |
MLABTree * | readTreeFromString (const QString &str, bool replaceVars) |
MLABTree * | readTreeFromFile (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) |
MLABTree * | newTree () |
MLABTree * | newTree (const QString &name, const QString &value) |
MLABTreeValidator * | newTreeValidator (MLABTree *validatorDefinition) |
void | deleteTreeValidator (MLABTreeValidator *treeValidator) |
MLABTreeValidator * | mdlValidator () |
bool | runMDLValidatorOnTree (MLABTree *tree) |
QString | replaceMDLVariables (const QString &text, const QString &localPath=QString()) |
Reading DICOM files. | |
MLABDicomTree * | loadDicomTree (const QString &filename, LoadDicomTreeOptions options=DicomNoOptions) |
QString | createDicomUid () |
Running MeVisLab macro modules as applications. | |
MLABApplicationRunner * | runApplication (const QString &name) |
MLABApplicationRunner * | runApplication (const QString &name, const QStringList &args) |
MLABApplicationRunner * | runApplication (const QString &name, const QStringList &args, MLABWidgetControl *parent) |
User activity measurement. | |
void | setUserActivityThreshold (int seconds) |
void | resetUserActivity () |
bool | isUserActive () |
Sign files. | |
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) |
MLABModule * | getModuleForInventorObject (SoFieldContainer *object) |
SQL databases | |
MLABScriptSqlDatabase * | addSqlDatabase (const QString &type) |
void | removeSqlDatabase (MLABScriptSqlDatabase *db) |
Properties | |
MLABMLScriptWrapper | ML |
Access to all global functions and objects of MLAB.
An instance of this class is available as global "MLAB" object in scripting.
|
slot |
Show the "about" screen.
|
slot |
Adds a new database connection of type
(where type can be "sqlite", "postgres", or "odbc").
Example:
|
slot |
Returns all known Inventor modules (even when not visible to the user).
|
slot |
Returns all known macro modules (even when not visible to the user).
|
slot |
Returns all known ML modules (even when not visible to the user).
|
slot |
Returns all known modules (even when not visible to the user).
|
slot |
Returns all modules contained in the specified package.
The package needs to be specified by "PackageGroup/Package", e.g., "MeVisLab/Standard".
|
slot |
Returns the build date of MeVisLab.
|
slot |
Clears the complete ML Cache.
|
slot |
Returns information about the used compiler.
|
slot |
Returns information about the computer model (e.g., for diagnostic purposes).
|
slot |
Copies a string to the pasteboard.
|
slot |
Returns a unique dicom uid with MeVis prefix and software type MeVisLab.
The method uses the DCMTree_Utils::UIDGenerator and offers a globally unique id using the process id, the time stamp and the mac address.
|
slot |
Creates a hyper link string with file part.
|
slot |
Creates a hyper link string with full path.
|
slot |
Creates a hyper link string with line number.
|
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.
|
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.
|
slot |
Crypts the given string and encodes it into base 64 string (with an internal default password).
|
slot |
Crypts the given string and encodes it into base64 string.
|
slot |
Returns the global cursor position.
|
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
|
slot |
Decrypts the given base64 encoded string and returns a decrypted string (with an internal default password), returns an empty string on error.
|
slot |
Decrypts the given base64 encoded string and returns a decrypted string, returns an empty string on error.
|
slot |
Deletes an MLABPrinter object.
|
slot |
sDelete a MLABProcess object (does NOT kill a started process, use kill() instead).
|
slot |
Deletes the given tree validator.
|
slot |
Returns the current system identification MLAB is running on.
Returns the following string depending on the system mlab is running on:
|
slot |
Converts a double to string with given format (format is as in printf, e.g., '%5.4f').
|
slot |
Opens the file with an external program (in edit mode).
|
slot |
Allows/Prevents the display of the global wait cursor (or any other system specific mean to inidicate 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.
|
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).
|
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.
|
slot |
Exit MeVisLab the hard way, scripting still goes on after this, its better to use terminate().
|
slot |
Returns a list of known module groups in the form "group":"number of modules":"names of modules".
|
slot |
Returns the field name with the components separated by space.
|
slot |
Returns the cache and locked memory size of the memory manager in KB.
|
slot |
Returns the cache and locked memory size limit of the memory manager in KB.
|
slot |
Returns the value of the environment variable.
|
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:
If no loader exists, the map is empty.
|
slot |
Returns a dictionary containing all files and directories on which the given macro modules depend.
The dictionary contains string lists for the keys:
includeModuleDirectories | specifies whether the directories in which the module definitions exist are included |
ignoredPackages | can be specified to ignore dependencies from certain packages |
|
slot |
Returns an MLABModuleDependency object for accessing the dependency data.
|
slot |
Returns the MLABModule for a C++ Open Inventor node/engine.
If the node/engine has no associated MLABInventorModule, NULL is returned.
|
slot |
Ask for a multi line requester which returns the text.
|
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.
|
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.
|
slot |
Returns access to the given script extension.
|
slot |
Checks spelling and returns a list of suggestions if the given word has not been recognized.
|
slot |
Returns whether license has a given feature.
|
slot |
Returns the md5 hash string for the given data string (converted from Unicode to UTF8).
|
slot |
Returns the md5 hash string for the given data string (converted from Unicode to Latin1).
|
slot |
Returns whether the given script extension is defined. The method doesn't try to load it.
|
slot |
Returns whether a global pref variable exists (from MeVisLab prefs and registry).
|
slot |
Gives scripting help for the MLAB object itself.
|
slot |
Gives scripting help for the given object (if available).
|
slot |
Gives scripting help for the given class name (if available).
|
slot |
Returns access to the IDE, especially for User Scripts.
|
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.
Referenced by setWaitCursor().
|
slot |
Converts an integer to string with given format (format is as in printf, e.g., 'x').
|
slot |
Returns all known inventor modules (that are visible to the user).
|
slot |
Returns whether MLAB is compiled in debug mode (release mode otherwise).
|
slot |
Returns whether system is Linux.
|
slot |
Returns whether system is Mac OS X.
|
slot |
Returns whether module profiling is enabled.
|
slot |
Returns whether the spelling of the given word is correct.
|
slot |
Returns whether MeVisLab runs a macro as standalone application.
|
slot |
Returns whether system is Linux or Mac OS X.
|
slot |
Returns whether the user is currently active (within the threshold).
|
slot |
Returns whether system is Windows.
|
slot |
Returns last clicked output field in an MeVislab network (might be NULL).
|
slot |
Returns the absolute path to the license that MeVisLab is currently using.
|
slot |
Loads a DICOM file and returns it as a tree object.
The tree is freed again when the last reference to it is removed.
With the options parameter you can specify what tags should be read:
The values must be or'ed together.
|
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.
|
slot |
Logs the given text to the console.
|
slot |
Log an error to the console.
|
slot |
Logs an error to the console (using HTML).
|
slot |
Logs the given text to the console, using a fixed size font and replacing spaces with .
|
slot |
Logs the given text to the console (using HTML).
|
slot |
Logs a warning to the console.
|
slot |
Logs a warning to the console (using HTML).
|
slot |
Returns whether a specific application specified by its bundle id is already running (Mac OS X only).
|
slot |
Returns all known macro modules (that are visible to the user).
|
slot |
Executes the given command with access to restricted areas of the operating system if user is authorized. Use with care (Mac OS X only).
Calling the function multiple times will reuse an existing authorization reference if and only if the securityEventId is still the same. The same security event id should only be used to authorize calls that "belong together", in the sense that the user should consider them a single security event. If they are meant to be separate, so that a user could meaningfully approve one but decline another, you should use a different security event id. An empty security event id will generate a new, unique security event id.
|
slot |
Returns the MDL control that is located at the current cursor position (or NULL if there is none).
|
slot |
Returns the MDL control that is located at the given global screen position (or NULL if there is none).
|
slot |
Returns the MDL control that is located at the given global screen position (or NULL if there is none).
|
slot |
Returns the MDL validator (used for module scripts / MDL GUI), the ownership stays with MeVisLab.
|
slot |
Returns all known ML modules (that are visible to the user).
|
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.
|
slot |
Returns all known modules (that are visible to the user).
|
slot |
Causes MLAB to sleep msecs milli seconds.
|
slot |
Creates a new HTTP download object (which is automatically garbage collected).
|
slot |
Creates a new mime data object that is owned by C++ and will not be deleted by PythonQt.
|
slot |
Creates a new process, see MLABPrinter class for its API.
You have to delete the returned pointer later on with deletePrinter!
|
slot |
Creates a new process, see MLABProcess class for its API.
You have to delete the returned pointer later on with deleteProcess!
|
slot |
Creates and returns a new tree element.
|
slot |
Creates and returns a new tree element.
|
slot |
Create and returns a new tree validator from the given MDL validator definition.
|
slot |
Opens the file with an external program (in open mode).
|
slot |
Opens the given URL with an external program.
|
slot |
Processes events (user events are filtered, just redrawing and timers are processed).
|
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.
|
slot |
Processes the delay queue of OpenInventor.
This is needed if you want to make sure that all pending OpenInventor notifications are processed.
|
slot |
Returns whether the given QObject inherits from the given classname.
|
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.
|
slot |
Parses the given MDL file, returns an empty tree on error.
|
slot |
Parses the given MDL file, returns an empty tree on error.
|
slot |
Reads the windows key, type may be one of CLASSES_ROOT, LOCAL_MACHINE, CURRENT_USER, USERS.
|
slot |
Removes the global wait cursor.
Referenced by removeWaitCursor().
|
slot |
Removes the last override cursor.
|
slot |
Remove the given database.
|
inlineslot |
References removeBusyStateIndicator().
|
slot |
Replaces MDL variables in a given string and returns it.
|
slot |
Resets the user activity measurement.
|
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:
|
slot |
Runs a macro module as an application.
|
slot |
Runs the application given by name.
The arguments are given as an array of strings. All arguments are optional. Possible entries are:
|
slot |
Like above but with a given parent application window.
|
slot |
Run the given executable command with given arguments array and return whether it was successful.
command | executable, may be absolute path or local in PATH environment |
arguments | list of arguments passed to command |
workingDir | working directory passed to command |
TODO: example code 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.
|
slot |
Runs the given executable command with given arguments array in a new process and detach from it.
Returns whether launch has been successful.
command | executable, may be absolute path or local in PATH environment |
arguments | list of arguments passed to command (can be empty list) |
workingDirectory,command | will be started in this directory (uses current directory if none is given) |
makeFrontmost,make | application front most on Mac OS X if set 'true' (default) |
|
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:
|
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:
Example:
|
slot |
Runs the MDL validator on the given tree and returns whether the tree was valid.
|
slot |
Sets whether MeVisLab will exit (and thus stop the Qt event loop) after the consoleCommand/runApplicationCommand has finished.
|
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.
fileName | The filename. |
treePath | List of tree names, and optionally values append to the tag name after a '#', that resembles the target tree hierarchy. |
value | The new value for the MDL tag. |
|
slot |
Sets whether module profiling is enabled.
|
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.
|
slot |
Sets the global override cursor to the given pixmap.
|
slot |
Sets the global override cursor to the given pixmap file.
|
slot |
Sets the global override cursor to the given pixmap file and sets the hot spot within that pixmap.
|
slot |
Sets the global user activity threshold in seconds, this also resets the user activity measurement.
|
slot |
Sets the value of a global pref variable (only transient, will be default on next restart).
|
inlineslot |
References indicateBusyState().
|
slot |
Global break checking which can be called from the scripting to allow pressing buttons which have the globalStop tag set to true.
|
slot |
Returns a QColor from a color dialog.
|
slot |
Returns a QColor from a color dialog, initialColor is given as a name (e.g., "white") or in hexadecimal notation (e.g., "#44cc88").
|
slot |
Shows a critical message box with graphically separated details and OK button.
|
slot |
Shows a critical message box with OK button.
|
slot |
Shows a critical error panel with given parameters, for details see showQuestion(), defaultButtonNumber
gives the default button starting from 0.
|
slot |
Shows a critical error panel with given parameters, for details see showQuestion(), defaultButtonNumber
gives the default button starting from 0.
|
slot |
Shows an information message box with graphically separated details and OK button.
|
slot |
Shows an information message box with OK button.
|
slot |
Shows an information panel with given parameters, for details see showQuestion(), defaultButtonNumber
gives the default button starting from 0.
|
slot |
Shows an information panel with given parameters, for details see showQuestion(), defaultButtonNumber
gives the default button starting from 0.
|
slot |
Shows a window with multi line text.
|
slot |
Shows a question panel with given parameters.
text | text to show |
detail | detailed information to show (e.g. a file or directory name) |
title | window title to show |
buttonTexts | list 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 |
defaultButtonNumber | button that is used when user presses return, starting from 0 for the first button |
parent | parent 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
|
|
slot |
Shows a question panel with given parameters, defaultButtonNumber
gives the default button starting from 0.
|
slot |
Shows a warning message box with graphically separated details and OK button.
|
slot |
Shows a warning message box with OK button.
|
slot |
Shows a warning message panel with given parameters, for details see showQuestion(), defaultButtonNumber
gives the default button starting from 0.
|
slot |
Shows a warning message panel with given parameters, for details see showQuestion(), defaultButtonNumber
gives the default button starting from 0.
|
slot |
Signs the files (absolute filenames) with the license that MeVisLab was started with.
|
slot |
Signs the files (absolute filenames) with the license file given as license
.
|
slot |
Signs the files with the license that MeVisLab was started with.
|
slot |
Signs the files with the license file given as license
.
|
slot |
Causes MLAB to sleep secs seconds.
|
slot |
Returns the name of the Macro module that is running as a MeVisLabApp standalone application (or empty string if MeVisLab itself is running).
|
slot |
Start dragging a QObject.
|
slot |
Converts a string URL to an encoded URL string (using xx encoding).
|
slot |
Returns the current system identification MLAB is running on/.
Returns the following string depending on the system mlab is running on:
If you want to get specific system information, use systemIdDetail().
|
slot |
Returns a detailed info string about the system, should not be used for checking purposes, use systemId() or detailedSystemId() instead.
|
slot |
Terminates the whole MeVisLab application, note that scripting goes on after this call and MLAB closes in the next event processing.
|
slot |
Translate a string with Qt's translation infrastructure.
|
slot |
Unsets a global pref variable (only transient, will be default on next restart).
|
slot |
Causes MLAB to sleep usecs micro seconds.
|
slot |
Returns whether the string value is true in the MeVisLab sense (Yes|1|On|True).
|
slot |
Returns the value of a global pref variable (read from MeVisLab prefs and registry).
|
slot |
Returns whether variable has YES/TRUE/1 as 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.
|
slot |
To make sure that settings set via setRegistryKey() are stored immediately, call this method.
|
slot |
Writes the given tree to a file.
|
slot |
Writes the given tree to a file.
|
read |
Provides access to ML global type functions.