MeVisLab Scripting Reference
MLABModule Class Reference

Inherits MLABFieldOwner.

Inherited by MLABInvalidModule, MLABMacroModule, and MLABMLModule.

Public Slots

MLABMacroModuleparentMacro () const
 
MLABMacroModuleparent ()
 
MLABMacroModuleapplicationMacro (bool shouldWarnIfNotMacro=true)
 
bool isDescendentOf (MLABModule *module)
 
bool isDescendentOfNetwork (MLABNetwork *network)
 
MLABNetworkparentNetwork () const
 
MLABNetworkowner ()
 
virtual MLABNetworknetwork ()
 
Scripting access to fields, modules, and controls.
void createScriptingContext (const QString &language)
 
bool hasFunction (const QString &functionName)
 
QVariant scriptVariable (const QString &name)
 
void setScriptVariable (const QString &name, const QVariant &value)
 
void deleteScriptVariable (const QString &name)
 
QVariant call (const QString &function, const QVariantList &args)
 
QVariant call (const QString &function)
 
QVariant call (const QString &function, QObject *obj)
 
QObject * callWithObjectReturn (const QString &function, const QVariantList &args)
 
QObject * callWithObjectReturn (const QString &function)
 
QObject * callWithObjectReturn (const QString &function, QObject *obj)
 
int callLater (double seconds, const QVariant &function, const QVariantList &args=QVariantList())
 
int callWithInterval (double seconds, const QVariant &function, const QVariantList &args=QVariantList())
 
QStringList callableFunctions ()
 
QStringList deprecatedFieldNames (const QString &fieldName)
 
QStringList deprecatedFieldNames (MLABField *field)
 
QVariantMap deprecatedFieldNames ()
 
void removeTimer (int id)
 
void removeTimers ()
 
QObject * commandHandler (const QString &name)
 
bool connectField (const QString &dst, const QString &src)
 
bool disconnectField (const QString &input)
 
virtual void clearCache ()
 
virtual MLABFieldfield (const QString &name)
 
bool hasField (const QString &name)
 
virtual MLABModulemodule (const QString &name)
 
bool hasModule (const QString &name)
 
QStringList modules ()
 
QList< MLABModule * > modulesAsObjects ()
 
virtual MLABModuleaddModule (const QString &name)
 
virtual MLABModuleaddMacroModuleFromString (const QString &string)
 
virtual MLABModuleaddMacroModuleFromFile (const QString &file)
 
virtual MLABModuleaddRemoteModule (const QString &name)
 
virtual MLABWidgetControlcontrol (const QString &name)
 
bool hasControl (const QString &name)
 
MLABWidgetControlcontrolDebug (const QString &name)
 
virtual void closeWindow ()
 
MLABWindowControlwindow ()
 
QString unexpandFilename (const QString &file)
 
QString expandFilename (const QString &file, bool doCleanPath=true)
 
QString localPath ()
 
QString networkPath ()
 
void log (const QString &msg)
 
void logFixed (const QString &text)
 
void logHTML (const QString &msg)
 
void logWarning (const QString &msg)
 
void logError (const QString &msg)
 
int currentWindowID ()
 
int setCurrentWindowID (int windowID)
 
void remove ()
 
void py_delete ()
 
void removeUndoable ()
 
QMap< QString, QVariant > getDependency ()
 
bool exportWindows (const QStringList &windowNames=QStringList()<< "_default")
 
bool callRemoteFunction (const QString &functionName, const QVariantList &arguments=QVariantList(), const QVariant &replyHandler=QVariant())
 
QStringList inputs ()
 
QStringList outputs ()
 
QStringList parameters ()
 
QList< MLABField * > inputFields ()
 
QList< MLABField * > outputFields ()
 
QList< MLABField * > parameterFields ()
 
bool isValid ()
 
void setNonPersistent ()
 
virtual bool isPersistent ()
 
QString type () const
 
virtual bool isRemote ()
 
virtual bool isLocalMacro ()
 
virtual QString fullName ()
 
QRect frame () const
 
void setFrame (const QRect &frame)
 
void setFrameTopLeft (int x, int y)
 
void setFrameCenter (int x, int y)
 
virtual bool isSelected () const
 
void setSelected (bool flag, bool notifyModuleListener=true)
 
void setSingleSelected ()
 
MLABPackagepackage ()
 
MLABPackagegetPackage ()
 
MLABWindowControlshowWindow (MLABWindowControl *parent=NULL)
 
MLABWindowControlshowWindow (const QString &name, MLABWindowControl *parent=NULL)
 
MLABWindowControlshowWindowFromString (const QString &string, MLABWindowControl *parent=NULL)
 
MLABWindowControlshowWindowFromFile (const QString &file, MLABWindowControl *parent=NULL)
 
MLABWindowControlshowAutomaticWindow ()
 
int showModalDialog (const QString &name, const QString &title)
 
int showModalDialog (const QString &name)
 
int showModalDialog ()
 
int showModalDialog (const QString &name, MLABWindowControl *parent)
 
int showModalDialogFromString (const QString &mdlString, const QString &title)
 
int showModalDialogFromString (const QString &mdlString)
 
int showModalDialogFromString (const QString &mdlString, MLABWindowControl *parent)
 
int showModalDialogFromFile (const QString &file, const QString &title)
 
int showModalDialogFromFile (const QString &file)
 
int showModalDialogFromFile (const QString &file, MLABWindowControl *parent)
 
MLABWindowControlcreateWindow ()
 
MLABWindowControlcreateWindow (MLABWindowControl *parent)
 
MLABWindowControlcreateWindow (const QString &name)
 
MLABWindowControlcreateWindow (const QString &name, MLABWindowControl *parent)
 
MLABWindowControlcreateWindowFromFile (const QString &file)
 
MLABWindowControlcreateWindowFromFile (const QString &file, MLABWindowControl *parent)
 
MLABWindowControlcreateWindowFromString (const QString &string)
 
MLABWindowControlcreateWindowFromString (const QString &string, MLABWindowControl *parent)
 
MLABWindowControlcreateBorderlessWindow (const QString &name, MLABWindowControl *parent)
 
MLABWindowControlcreatePopupWindow (const QString &name, MLABWindowControl *parent)
 
MLABWindowControlcreateModalDialog (const QString &name, MLABWindowControl *parent)
 
bool hasWindow (const QString &name)
 
void closeAllWindows (bool emitDestroyedCommandImmediately=false)
 
void reshowClosedWindows ()
 
virtual MLABWindowControlshowParameterWindow ()
 
void updateLayout ()
 
void createConnectors ()
 
MLABFieldListeneraddFieldListener (MLABField *field, const QVariant &script, bool init)
 
void removeFieldListener (MLABFieldListener *listener)
 
QString groupName () const
 
void addToGroup (const QString &name)
 
- Public Slots inherited from MLABFieldOwner
virtual bool isSelected () const =0
 
virtual bool isPersistent ()=0
 
virtual MLABNetworkparentNetwork () const =0
 
virtual QString fullName ()=0
 

Friends

class MLABNetwork
 

Detailed Description

Baseclass for modules in an MLABNetwork.

All scripts contexts in MLAB have a global "context" variable (alias: "ctx") which can be accessed from the script. This context variable always points to an MLABModule, either an MLABMacroModule, MLABMLModule, or MLABInventorModule. All methods given in this documentation can be called by:

ctx.methodName(arg1,arg2,...);

Typical used methods in a module are:

Utility functions:

Methods concerning windows (panels):

Less typical methods in a module are:

MDL reference: Module

Member Function Documentation

MLABFieldListener* MLABModule::addFieldListener ( MLABField field,
const QVariant &  script,
bool  init 
)
slot

Adds a field listener to the module at runtime.

The passed in script can be a string or a callable Python object (e.g., a function or instance method). For example, if you have a scripting function called myFieldChanged(), then you can register it like this:

ctx.addFieldListener(anyModule.field("anyField"), "myFieldChanged", False)
Parameters
scriptThe script is executed in the context the module you call this method on.
initIf this flag is true, the myFieldChanged function is called and the current field value is propagated.
virtual MLABModule* MLABModule::addMacroModuleFromFile ( const QString &  file)
virtualslot

Adds a new module from a string to the internal network temporarily.

The module type will be MacroFromFile.

(This should only be used for application specific macros that should not be visible in the global MLAB database and that are generated on the fly in Scripting, the module is not persistent when you save the network.)

virtual MLABModule* MLABModule::addMacroModuleFromString ( const QString &  string)
virtualslot

Adds a new module from a string to the internal network temporarily.

The module type will be MacroFromString.

(This should only be used for very small macros that are generated on the fly in Scripting, the module is not persistent when you save the network.)

virtual MLABModule* MLABModule::addModule ( const QString &  name)
virtualslot

Adds a new module to the internal network (return null or new module).

The module can be a name from the MLAB database or a local macro (if the module is a local macro module, looks for networkPath() + "name.script").

virtual MLABModule* MLABModule::addRemoteModule ( const QString &  name)
inlinevirtualslot

Adds a new module executed by a worker instance of MeVisLab in another process.

Some restrictions on GUI scripting and allowed input and output field types apply.

This does not work for local modules or OpenInventor modules.

References addRemoteModule().

Referenced by addRemoteModule().

void MLABModule::addToGroup ( const QString &  name)
slot

Adds the module to the given group (if the name does not exist, a new group with that name is created).

If the name is empty, the module is moved to the top network level.

MLABMacroModule* MLABModule::applicationMacro ( bool  shouldWarnIfNotMacro = true)
slot

Returns the MacroModule which is the top most in the parent chain, being the started application.

QVariant MLABModule::call ( const QString &  function,
const QVariantList &  args 
)
slot

Calls the given function inside of the module, the method can be global or fully qualified (e.g. someobject.somefunction), arguments are a Python list of values (these args can not be objects or classes)

QVariant MLABModule::call ( const QString &  function)
slot

Like call() method, but without arguments.

QVariant MLABModule::call ( const QString &  function,
QObject *  obj 
)
slot

Like call() method, but with object as argument.

QStringList MLABModule::callableFunctions ( )
slot

Returns a list of callable scripting functions (callable with call()).

int MLABModule::callLater ( double  seconds,
const QVariant &  function,
const QVariantList &  args = QVariantList() 
)
slot

Like call() method but calls after the given number of seconds.

If seconds is 0, it is guaranteed that the call is done AFTER the current event loop. The passed in function can be a string or a callable Python object (e.g. a function or instance method).

Returns
Returns a unique timer id that can be used with removeTimer() to stop the timer.
bool MLABModule::callRemoteFunction ( const QString &  functionName,
const QVariantList &  arguments = QVariantList(),
const QVariant &  replyHandler = QVariant() 
)
slot

Calls a function on a remote client.

If this module is not running in a worker process, then an error is printed.

Parameters
functionNameThe name of the function.
argumentsThe argument list. This is optional.
replyHandlerA callable that is called with the reply argument list as parameters. This is optional.
Returns
Returns true if the module is managed by a remote connection and the sendGenericRequest() signal was emitted, false otherwise.
int MLABModule::callWithInterval ( double  seconds,
const QVariant &  function,
const QVariantList &  args = QVariantList() 
)
slot

Like call() method but calls repeatedly in the given interval.

To stop the timer, use the kill() method on the returned timer object. The passed in function can be a string or a callable Python object (e.g. a function or instance method).

Returns
Returns a unique timer id that can be used with removeTimer() to stop the timer.
QObject* MLABModule::callWithObjectReturn ( const QString &  function,
const QVariantList &  args 
)
slot

Like call() method, but with object as return value.

QObject* MLABModule::callWithObjectReturn ( const QString &  function)
slot

Like call() method, but with object as return value.

QObject* MLABModule::callWithObjectReturn ( const QString &  function,
QObject *  obj 
)
slot

Like call() method, but with object as return value.

virtual void MLABModule::clearCache ( )
virtualslot

Clears the ML cache of all output fields of this module and also of all modules inside of the internal network if it is a macro network.

void MLABModule::closeAllWindows ( bool  emitDestroyedCommandImmediately = false)
slot

Closes all windows (you can reshow the windows at the same screen positions by calling reshowClosedWindows).

virtual void MLABModule::closeWindow ( )
virtualslot

Closes current window (depending on current window).

QObject* MLABModule::commandHandler ( const QString &  name)
slot

Returns the command handler named name, if name is empty returns the first unnamed commandHandler.

bool MLABModule::connectField ( const QString &  dst,
const QString &  src 
)
slot

Connects input field dst to output field src, fields are given by their string name.

(Note: this is a shortcut to MLABField connectFrom().)

virtual MLABWidgetControl* MLABModule::control ( const QString &  name)
virtualslot

Searches for control with given name (in current active window, see currentWindowID()).

Searches for a control which must be declared in the current active window by the MDL tag "instanceName" (alias: "name"). Note that control() will only return the correct control if the script code is called from somewhere in the MDL GUI, NOT when you try to call it from commands of the MDL Commands section or from the scripting console.

Example:

Button {
title = "Button1"
name = button1
command = "*js: var b = ctx.control("button1"); b.setTitle("SomeText"); } *"
}

When called from a scripting console, the method will automatically use controlDebug() and return the first control it finds with that name in any of the opened windows.

MLABWidgetControl* MLABModule::controlDebug ( const QString &  name)
slot

Like hasControl(), but ignores the current window context and searches through all open window.

This method is for debugging in the Scripting console, because control() will not return a control that is not in the correct window context.

MLABWindowControl* MLABModule::createBorderlessWindow ( const QString &  name,
MLABWindowControl parent 
)
slot

Creates a borderless window that is a child of the given window (if window is omitted, it will have no parent).

This function can be used to create information windows that are shown/hidden by the application and can not be moved/closed by the user. Note that the window is not shown after creation, you have to call show() to make it visible and you can use one of the methods of MLABWindowControl to place it at the correct position e.g. move() or moveTo().

void MLABModule::createConnectors ( )
slot

Creates the field connectors of the visual by communicating with the module listener.

If the module listener is NULL, nothing is done.

MLABWindowControl* MLABModule::createModalDialog ( const QString &  name,
MLABWindowControl parent 
)
slot

Creates a modal dialog that is a child of the given window (if window is omitted, it will have no parent).

Note that the window is not shown after creation, you have to call MLABWindowControl::exec() on the window to show it (exec() then returns the accept/reject code).

MLABWindowControl* MLABModule::createPopupWindow ( const QString &  name,
MLABWindowControl parent 
)
slot

Creates a popup window that is a child of the given (if window is omitted, it will have no parent).

Note that the window is not shown after creation, you have to call show() to make it visible and you can use one of the methods of MLABWindowControl to place it at the correct position e.g. move() or moveTo().

void MLABModule::createScriptingContext ( const QString &  language)
slot

Creates scripting context for given language if not already done.

MLABWindowControl* MLABModule::createWindow ( )
slot

Creates the module's default window (the first window found in the tree, or with the name _default).

Creating does not show the window, use methods from MLABWindowControl to show the window after creation. If window was already created, this method returns the pointer to the old instantiated window.

MLABWindowControl* MLABModule::createWindow ( MLABWindowControl parent)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

MLABWindowControl* MLABModule::createWindow ( const QString &  name)
slot

Creates window with name (_default, _automatic and _viewer are special names that can be used).

Creating does not show the window, use methods from MLABWindowControl to show the window after creation. If window was already created, this method returns the pointer to the old instantiated window.

MLABWindowControl* MLABModule::createWindow ( const QString &  name,
MLABWindowControl parent 
)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

MLABWindowControl* MLABModule::createWindowFromFile ( const QString &  file)
slot

Creates window which is read from file.

MLABWindowControl* MLABModule::createWindowFromFile ( const QString &  file,
MLABWindowControl parent 
)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

MLABWindowControl* MLABModule::createWindowFromString ( const QString &  string)
slot

Creates window which is parsed from the given string.

MLABWindowControl* MLABModule::createWindowFromString ( const QString &  string,
MLABWindowControl parent 
)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int MLABModule::currentWindowID ( )
slot

Returns the currently active window id.

void MLABModule::deleteScriptVariable ( const QString &  name)
slot

Deletes the script variable from the script context.

QStringList MLABModule::deprecatedFieldNames ( const QString &  fieldName)
slot

Returns a list of deprecated names for the given field name.

QStringList MLABModule::deprecatedFieldNames ( MLABField field)
slot

Returns a list of deprecated names for the given field.

QVariantMap MLABModule::deprecatedFieldNames ( )
slot

Returns a dictionary of deprecated names for all fields.

bool MLABModule::disconnectField ( const QString &  input)
slot

Disconnects input field from output field (input field is given as string name).

(Note: this is a shortcut to MLABField disconnect().)

QString MLABModule::expandFilename ( const QString &  file,
bool  doCleanPath = true 
)
slot

Expands variable strings starting with $(...) in given filename.

Trailing (back-)slashes are removed if the result is a directory.

This function supports:

  • LOCAL - local path of def/script file this module is defined in
  • NETWORK - local path of network file this module instance is in
  • MLAB_xxx_yyy - where xxx is an existing package group and yyy an existing package name
  • DemoDataPath - path to MeVisLab DemoData

and all variables that are given in mevislab.prefs file. If doCleanPath is set multiple directory separators are removed and any '.' and '..' is resolved.

bool MLABModule::exportWindows ( const QStringList &  windowNames = QStringList()<< "_default")
slot

Makes the given window and relevant fields available to remote clients by exporting the fields and MDL window definitions.

This function will do nothing if this module is not running in a worker process. It must be called on the application module, otherwise it has no effect.

Parameters
windowNamesAn optional list of windows to export. If it is omitted, then the default window of this module will be exported. The names may contain dots to specify windows of sub modules.
Returns
Returns true if the module is managed by a module server connection and the exportWindowDefinitions() signal was emitted, false otherwise.
virtual MLABField* MLABModule::field ( const QString &  name)
virtualslot

Searches for field with given name in dotted notation.

Searches the field by its name. The name can be the name of a field in this module, or a field in the internal network of the macro module. If an internal field is accessed, the name is constructed with the module's instanceName, "." and the field name.

Example for a simple module field and an internal field:

field1 = ctx.field("somefield")
field2 = ctx.field("somemodule.somefield")

See MLABField and its derived classes to learn what methods are available on fields.

You can also access field in the parent module of the current module. And you can go up with "parent:" and go done with "." as you wish. This is an advanced feature and should only be used if really needed because it breaks encapsulation!

Example for a parent module's field:

parentField1 = ctx.field("parent:somefield")
parentField2 = ctx.field("parent:somemodule.somefield")
QRect MLABModule::frame ( ) const
slot

Returns the frame of module (world coords) on network sheet.

virtual QString MLABModule::fullName ( )
virtualslot

Returns the full name (type + instanceName) for debugging only.

QMap<QString, QVariant> MLABModule::getDependency ( )
slot

Returns the dependency of the module.

map contains string lists for the keys:

  • "dirs"
  • "dlls"
  • "modules"
MLABPackage* MLABModule::getPackage ( )
inlineslot

Returns access to the package of the module (may be NULL if not registered with any package, e.g.

a local macro module) this method is the same as package(), but is required for JavaScript users, since "package" is a QSA keyword.

QString MLABModule::groupName ( ) const
inlineslot

Returns the group to which the module belongs.

Do not return a reference to the group name, because only None will be returned in Python then.

bool MLABModule::hasControl ( const QString &  name)
slot

Returns whether a control with name exists in the current context.

bool MLABModule::hasField ( const QString &  name)
slot

Returns whether the module has this field and it can be read by field().

bool MLABModule::hasFunction ( const QString &  functionName)
slot

Checks whether the module has the given script function to call with MLABModule::call.

bool MLABModule::hasModule ( const QString &  name)
slot

Returns whether the module exists in the network.

bool MLABModule::hasWindow ( const QString &  name)
slot

Checks whether a window with the given name is defined.

QList<MLABField*> MLABModule::inputFields ( )
slot

Returns a list of all input fields as scriptable objects.

QStringList MLABModule::inputs ( )
slot

Returns the input fields (as list of field names).

bool MLABModule::isDescendentOf ( MLABModule module)
slot

Returns whether this module is a descendant of the given module.

That means that this module is inside the given module (macro) in any recursion level.

bool MLABModule::isDescendentOfNetwork ( MLABNetwork network)
slot

Returns whether this module is a descendant of the given network.

That means that this module is inside the given network in any recursion level.

virtual bool MLABModule::isLocalMacro ( )
inlinevirtualslot

Returns whether this module is a local macro module.

Reimplemented in MLABMacroModule.

virtual bool MLABModule::isPersistent ( )
inlinevirtualslot

Returns whether the module is persistent and will be written to a *.mlab file if saved or copied.

virtual bool MLABModule::isRemote ( )
inlinevirtualslot

Returns whether the module is remotely executed in a worker instance.

Reimplemented in MLABRemoteModule.

bool MLABModule::isValid ( )
inlineslot

Returns whether this module is valid.

QString MLABModule::localPath ( )
slot

returns the local path of module's def/script file.

void MLABModule::log ( const QString &  msg)
slot

Logs a message for this module.

void MLABModule::logError ( const QString &  msg)
slot

Logs an error message for this module.

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

Logs a message for this module, using a fixed size font and replacing spaces with   .

void MLABModule::logHTML ( const QString &  msg)
slot

Logs a message for this module (using HTML).

void MLABModule::logWarning ( const QString &  msg)
slot

Logs a warning message for this module.

virtual MLABModule* MLABModule::module ( const QString &  name)
virtualslot

Searches for module with given name.

Searches for a module with a given instanceName inside the internal network of this module.

Example:

mod = ctx.module("ImageLoad")

Reimplemented in MLABMacroModule.

QStringList MLABModule::modules ( )
slot

Returns the instanceNames of all modules in the network.

QList<MLABModule*> MLABModule::modulesAsObjects ( )
slot

Returns a list of all modules in the network as scriptable objects.

virtual MLABNetwork* MLABModule::network ( )
inlinevirtualslot

Returns the internal network (used in MacroModules, do not mix this up with parentNetwork()! ).

Reimplemented in MLABMacroModule.

QString MLABModule::networkPath ( )
slot

Returns the local path of network the module instance is in (may be empty if network was not saved).

QList<MLABField*> MLABModule::outputFields ( )
slot

Returns a list of all output fields as scriptable objects.

QStringList MLABModule::outputs ( )
slot

Returns the output fields (as list of field names).

MLABNetwork* MLABModule::owner ( )
inlineslot

Deprecated, please use parentNetwork() instead.

References MLABFieldOwner::parentNetwork().

MLABPackage* MLABModule::package ( )
slot

Returns access to the package of the module (may be NULL if not registered with any package, e.g. a local macro module).

QList<MLABField*> MLABModule::parameterFields ( )
slot

Returns a list of all parameter fields as scriptable objects.

QStringList MLABModule::parameters ( )
slot

Returns the parameter fields (as list of field names).

MLABMacroModule* MLABModule::parent ( )
inlineslot

Deprecated, since this is an overload of the QObject::parent() call, please use parentMacro() instead.

MLABMacroModule* MLABModule::parentMacro ( ) const
slot

Returns the parent MacroModule (this can be used to call scripting methods on the owning MacroModule).

MLABNetwork* MLABModule::parentNetwork ( ) const
slot

Returns the owning parent network.

void MLABModule::remove ( )
slot

Removes this module from the network, this will cause an immediate deletion of the module.

void MLABModule::removeFieldListener ( MLABFieldListener listener)
slot

Removes the given field listener.

void MLABModule::removeTimer ( int  id)
slot

Removes (stops) the given timer (id is from callLater or callWithTimer, the timer must be created in this context).

void MLABModule::removeTimers ( )
slot

Removes (stops) all timers inside of this context (this is automatically called on reload and remove of the module).

void MLABModule::removeUndoable ( )
slot

Removes this module from the network and put it into the undo history (the module will not be deleted immediately).

void MLABModule::reshowClosedWindows ( )
slot

Re-shows panels that have been previously closed.

QVariant MLABModule::scriptVariable ( const QString &  name)
slot

Returns the given variable from scripting.

int MLABModule::setCurrentWindowID ( int  windowID)
slot

Sets the currently active window id (returns old id).

void MLABModule::setFrame ( const QRect &  frame)
slot

Sets the frame of module (world coords) on network sheet, typically one should better use setFrameTopLeft() or setFrameCenter(), to update the layout of the module, call updateLayout().

void MLABModule::setFrameCenter ( int  x,
int  y 
)
slot

Sets the frame center of the module (in world coords) on network sheet, module is moved to given center, the size is kept.

void MLABModule::setFrameTopLeft ( int  x,
int  y 
)
slot

Sets the frame topleft of the module (in world coords) on network sheet, module is moved to given topleft position, the size is kept.

void MLABModule::setNonPersistent ( )
inlineslot

Sets that the module is not persistent, so it will not be written to *.mlab files (and not be copy/pastable).

void MLABModule::setScriptVariable ( const QString &  name,
const QVariant &  value 
)
slot

Sets the given variable in the script context to the given value.

void MLABModule::setSelected ( bool  flag,
bool  notifyModuleListener = true 
)
slot
void MLABModule::setSingleSelected ( )
slot

Sets only this module selected (deselects all other modules first).

MLABWindowControl* MLABModule::showAutomaticWindow ( )
slot

Shows the module's automatic window showing all fields of the module.

int MLABModule::showModalDialog ( const QString &  name,
const QString &  title 
)
slot

Shows modal dialog (returns 1 on accept and 0 on cancel).

Rhe shown dialog can be closed by calling

ctx.window()->accept()

to close and accept (return value 1)

ctx.window()->reject()

to close and reject (return value 0) or you can call

ctx.window()->done(int result)

where the result gets returned to the caller of showModalDialog().

int MLABModule::showModalDialog ( const QString &  name)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int MLABModule::showModalDialog ( )
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int MLABModule::showModalDialog ( const QString &  name,
MLABWindowControl parent 
)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int MLABModule::showModalDialogFromFile ( const QString &  file,
const QString &  title 
)
slot

Show a modal dialog which is read from file.

int MLABModule::showModalDialogFromFile ( const QString &  file)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int MLABModule::showModalDialogFromFile ( const QString &  file,
MLABWindowControl parent 
)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int MLABModule::showModalDialogFromString ( const QString &  mdlString,
const QString &  title 
)
slot

Shows a modal dialog which is parsed from the given string.

int MLABModule::showModalDialogFromString ( const QString &  mdlString)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

int MLABModule::showModalDialogFromString ( const QString &  mdlString,
MLABWindowControl parent 
)
slot

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

virtual MLABWindowControl* MLABModule::showParameterWindow ( )
virtualslot

Shows the default window as a panel.

MLABWindowControl* MLABModule::showWindow ( MLABWindowControl parent = NULL)
slot

Shows the module's default window (the first window found in the tree, or with the name _default).

MLABWindowControl* MLABModule::showWindow ( const QString &  name,
MLABWindowControl parent = NULL 
)
slot

Shows window with name (_default, _automatic and _viewer are special names that can be used).

MLABWindowControl* MLABModule::showWindowFromFile ( const QString &  file,
MLABWindowControl parent = NULL 
)
slot

Shows window created from file.

MLABWindowControl* MLABModule::showWindowFromString ( const QString &  string,
MLABWindowControl parent = NULL 
)
slot

Shows window created from string.

QString MLABModule::type ( ) const
slot

Returns the type of contained object (as string).

QString MLABModule::unexpandFilename ( const QString &  file)
slot

Unexpands a filename string containing variables starting with $(...) (see expandFilename() for details).

void MLABModule::updateLayout ( )
slot

Updates the layout of module (string position, connectors, etc.).

If the module listener is NULL, nothing is done.

MLABWindowControl* MLABModule::window ( )
slot

Returns the current window (depending on current window).