MeVisLab Scripting Reference
|
#include <mlabGlobalScriptAccess.h>
Inherits QObject.
Public Types | |
enum | LoadDicomTreeOptions { DicomNoOptions = MLABDicom::DicomNoOptions , DicomReadPixelData = MLABDicom::DicomReadPixelData , DicomReadPrivateTags = MLABDicom::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 | 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) |
MLABProcess * | newProcess () |
void | deleteProcess (MLABProcess *process) |
MLABHttpDownload * | newHttpDownload () |
Printing | |
| |
MLABPrinter * | newPrinter () |
void | deletePrinter (MLABPrinter *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 () |
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 | startObjectDrag (QObject *object, 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) |
MLABField * | lastClickedOutputField () |
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) |
MLABRecentFilesHandler * | 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) |
MLABModuleDependency * | getModuleDependency (const QStringList &moduleNames, bool includeModuleDirectories=true, bool includeWebContents=false, bool includeModuleHelpFiles=false, MLABNetwork *scannedNetwork=nullptr) |
MLABModuleDependency * | 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. | |
| |
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, deprecated and moved to MLABDicom. | |
| |
MLABMutableDicomTree * | 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) |
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) |
MLABModule * | getModuleForInventorObject (SoFieldContainer *object) |
SQL databases | |
| |
MLABSqlDatabase * | addSqlDatabase (const QString &type) |
void | removeSqlDatabase (MLABSqlDatabase *db) |
Properties | |
int | MEVISLAB_VERSION |
QString | MEVISLAB_VERSION_STRING |
MLABMLScriptWrapper * | ML |
Access to all global functions and objects of MLAB.
An instance of this class is available as global "MLAB" object in scripting.
enum MLAB::LoadDicomTreeOptions |
|
slot |
Show the "about" screen.
|
slot |
Return information about used third-party libraries as HTML text, which can be used in the about box of own applications.
|
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 |
Return if the given license file (or the currently used license if none was given) can sign files.
|
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 |
Please use MLABDicom.createDicomUid() instead of this method.
|
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.
This method only works for classes derived from ml::RefCountedBase, such as ml::WEM or ml::CSOList, for instance.
|
slot |
Creates a recent file handler.
|
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.
|
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.
|
slot |
Returns the global cursor position.
|
slot |
Returns the date of the build job in which the MeVisLab installer was build.
it returns the same as buildDate().
|
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, 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.
|
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.
|
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 |
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.
|
slot |
Returns the current system identification MLAB is running on.
Returns the following string depending on the system mlab is running on:
|
slot |
Logs the given diagnostic text to the console (diagnostics can be turned off globally).
|
slot |
Logs the given diagnostic HTML text to the console (diagnostics can be turned off globally).
|
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 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.
|
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:
moduleNames | The names of the modules to analyze. |
includeModuleDirectories | specifies whether the directories in which the module definitions exist are included |
ignoredPackages | can be specified to ignore dependencies from certain packages |
includeWebContents | can be specified to include web contents |
includeModuleHelpFiles | can be specified to include help contents |
scannedNetwork | the network that is scanned (mainly to get the network path) |
|
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 an MLABModuleDependency object for accessing the dependency data of the test cases in the given packages.
|
slot |
Return tickets of the given license file (or of the currently used license if none was given)
|
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 class name (if available).
|
slot |
Gives scripting help for the given object (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.
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:
|
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 |
Return if the given license file (or the currently used license if none was given) is currently valid.
|
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 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 |
Please use MLABDicom.loadDicomTree() instead of this method.
|
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 all known macro modules (that are visible to the user).
|
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.
|
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.
|
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 |
Return all file names used for preferences setup.
|
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.
|
slot |
Removes the last override cursor.
|
slot |
Remove the given database.
|
slot |
|
slot |
Replaces MDL variables in a given string and returns it.
|
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 |
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) |
|
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 |
Enables high precision timestamps for log messages that include microseconds.
Returns if the logging time stamps were enabled or disabled previously.
|
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 |
Set the global should stop flag, this can be used to debug/test Python code that runs in in a shouldStop() loop.
|
slot |
Sets the value of a global pref variable (only transient, will be default on next restart).
|
slot |
|
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 error panel with given parameters, for details see showQuestion(), defaultButtonNumber
gives the default button starting from 0.
|
slot |
Shows a critical message box with graphically separated details and 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 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 message box with graphically separated details and 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 message box with OK button.
|
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
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. |
|
slot |
Shows a question panel with given parameters, 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 |
Shows a warning message box with graphically separated details and 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 box with OK button.
|
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 |
Return file name provided with -prefs parameter.
|
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 writeKey() are stored immediately, call this method.
|
slot |
Writes the given tree to a file.
|
slot |
Writes the given tree to a file.
|
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.
|
read |
The complete version of MeVisLab as a string.
This is the version as shown in the About dialog.
|
read |
Provides access to ML global type functions.