Inherits QObject.
Inherited by MLABAccelControl, MLABColorEditControl, MLABCommonButtonGroupControl, MLABDicomBrowserTableControl, MLABEmptyControl, MLABEventFilterControl, MLABFieldControl, MLABFieldListControl, MLABFieldListenerControl, MLABFreeFloatControl, MLABGridControl, MLABIntervalSliderControl, MLABInventorMaterialEditorControl, MLABKeyFrameEditorControl, MLABLogControl, MLABMenuBarControl, MLABNetworkViewControl, MLABNumberControl, MLABPackageManagerControl, MLABPathBrowserControl, MLABPopupMenuControl, MLABProgressBarControl, MLABScriptConsoleControl, MLABShortcutEditorControl, MLABSimpleWidgetControl, MLABSliderControl, MLABTabViewControl, MLABTextViewControl, MLABThumbWheelControl, MLABVectorControl, and MLABWindowControl.
Base class for controls in MLAB.
This base class offers a number of methods that can be called from scripting to change its state.
bool MLABWidgetControl::acceptDrops |
( |
| ) |
|
|
inlineslot |
Returns whether the control accepts drops.
void MLABWidgetControl::adjustSize |
( |
| ) |
|
|
slot |
Adjusts the widget size according to its size hint.
QString MLABWidgetControl::applicationName |
( |
| ) |
|
|
slot |
Returns the name of the application macro this module is in.
virtual void MLABWidgetControl::applyUncommittedChanges |
( |
| ) |
|
|
inlinevirtualslot |
Returns a named control in the context of this control.
QString MLABWidgetControl::createGlobalScreenshot |
( |
| ) |
|
|
slot |
Creates a global screenshot which goes to the screenshot gallery.
If successful, it also creates a thumb nail and returns the file name.
virtual bool MLABWidgetControl::createScreenshot |
( |
const QString & |
filename, |
|
|
bool |
grabFromScreen = true |
|
) |
| |
|
virtualslot |
Creates a snapshot in the given filename with the specified format.
The area that is grabbed will not contain the mouse cursor, but any other windows that are in front of this control will also be grabbed. This method is also able to grab Open Inventor viewers with their current OpenGL image.
the format is read from the given extension, available formats are:
Reimplemented in MLABInventorViewerControl.
void MLABWidgetControl::displayWhatsThis |
( |
| ) |
|
|
slot |
Shows the Whats This text for the control (using the MDL whatsThis tag).
void MLABWidgetControl::displayWhatsThis |
( |
const QString & |
text | ) |
|
|
slot |
Displays the given richtext on this control.
bool MLABWidgetControl::expandX |
( |
| ) |
|
|
inlineslot |
Returns whether the control should expand horizontally.
bool MLABWidgetControl::expandY |
( |
| ) |
|
|
inlineslot |
Returns whether the control should expand vertically.
MLABTreePtr MLABWidgetControl::getDefaultTagValues |
( |
| ) |
const |
|
slot |
Returns a tree containing default tag values which have not been specified.
Tags that do not have a simple default value or string tags are excluded.
QString MLABWidgetControl::getName |
( |
| ) |
|
|
inlineslot |
Returns the name of the control which has been set via "name" or "instanceName" tag.
QString MLABWidgetControl::getType |
( |
| ) |
|
|
inlineslot |
Returns the type of the control, e.g., "MLABLabelControl" for a label.
virtual bool MLABWidgetControl::hasFocus |
( |
| ) |
|
|
inlinevirtualslot |
Returns whether this control has the keyboard focus.
virtual bool MLABWidgetControl::hasUncommittedChanges |
( |
| ) |
const |
|
inlinevirtualslot |
Return true if this control has uncommitted changes (currently only applies to TextView control)
Reimplemented in MLABTextViewControl.
int MLABWidgetControl::height |
( |
| ) |
|
|
inlineslot |
Returns the height of the widget.
bool MLABWidgetControl::isReloadable |
( |
| ) |
const |
|
inlineslot |
Returns whether this control can be reloaded with a new tree.
This is used by the GUI editor to partly update panels.
virtual bool MLABWidgetControl::isVisible |
( |
| ) |
|
|
virtualslot |
Returns whether this control is visible.
QLayout* MLABWidgetControl::layout |
( |
| ) |
|
|
inlineslot |
Returns the layout of the main QWidget of this control (this widget may be different depending on tags used in the control).
int MLABWidgetControl::maxHeight |
( |
| ) |
|
|
inlineslot |
Returns the maximum height of the widget.
QSize MLABWidgetControl::maxSize |
( |
| ) |
|
|
inlineslot |
Returns the maximum size of the widget.
int MLABWidgetControl::maxWidth |
( |
| ) |
|
|
inlineslot |
Returns the maximum width of the widget.
int MLABWidgetControl::minHeight |
( |
| ) |
|
|
inlineslot |
Returns the minimum height of the widget.
QSize MLABWidgetControl::minSize |
( |
| ) |
|
|
inlineslot |
Returns the minimum size of the widget.
int MLABWidgetControl::minWidth |
( |
| ) |
|
|
inlineslot |
Returns the minimum width of the widget.
Returns the module associated with this GUI element.
void MLABWidgetControl::raiseWidget |
( |
| ) |
|
|
slot |
Raises the underlying widget (can not be called raise because raise() is a keyword in python).
void MLABWidgetControl::reload |
( |
MLABTree * |
tree | ) |
|
|
slot |
Reloads this control with the new tree if isReloadable() returns true.
virtual void MLABWidgetControl::revertUncommittedChanges |
( |
| ) |
|
|
inlinevirtualslot |
Revert uncommitted changes; this mainly exists to prevent a second request dialog opening on closing if changes were discarded in the shouldCloseCommand.
Reimplemented in MLABTextViewControl.
float MLABWidgetControl::scaleFactor |
( |
| ) |
|
|
inlineslot |
Returns the GUI scale factor for this widget.
void MLABWidgetControl::setAcceptDrops |
( |
bool |
flag | ) |
|
|
inlineslot |
Sets whether the control accepts drops.
virtual void MLABWidgetControl::setEnabled |
( |
bool |
flag | ) |
|
|
virtualslot |
Enables/disables the control.
virtual void MLABWidgetControl::setFocus |
( |
| ) |
|
|
inlinevirtualslot |
void MLABWidgetControl::setMaxHeight |
( |
int |
s | ) |
|
|
inlineslot |
Sets the maximum height of the widget.
void MLABWidgetControl::setMaxSize |
( |
QSize |
size | ) |
|
|
inlineslot |
Sets the maximum size of the widget.
void MLABWidgetControl::setMaxWidth |
( |
int |
s | ) |
|
|
inlineslot |
Sets the maximum width of the widget.
virtual void MLABWidgetControl::setMinHeight |
( |
int |
s | ) |
|
|
inlinevirtualslot |
void MLABWidgetControl::setMinSize |
( |
QSize |
size | ) |
|
|
inlineslot |
Sets the minimum size of the widget.
virtual void MLABWidgetControl::setMinWidth |
( |
int |
s | ) |
|
|
inlinevirtualslot |
void MLABWidgetControl::setStyleSheetFromFile |
( |
const QString & |
styleSheetFileName | ) |
|
|
slot |
Sets the Qt style sheet value from a file.
void MLABWidgetControl::setStyleSheetFromString |
( |
const QString & |
styleSheetText | ) |
|
|
slot |
Sets the Qt style sheet value.
virtual void MLABWidgetControl::setTitle |
( |
const QString & |
| ) |
|
|
virtualslot |
Set the title of the widget (this method is reimplemented in the different widgets).
Please note that this method will be removed in the future, so that it can only be called on derived classes which actually support a title.
Reimplemented in MLABWindowControl.
virtual void MLABWidgetControl::setToolTip |
( |
const QString & |
string | ) |
|
|
virtualslot |
Sets a tool tip text for the control.
virtual void MLABWidgetControl::setVisible |
( |
bool |
flag | ) |
|
|
virtualslot |
Makes the control visible/invisible.
virtual void MLABWidgetControl::setWhatsThis |
( |
const QString & |
string | ) |
|
|
virtualslot |
Sets a Whats This text for the control.
QSize MLABWidgetControl::size |
( |
| ) |
|
|
inlineslot |
Returns the size of the widget.
QSize MLABWidgetControl::sizeHint |
( |
| ) |
|
|
inlineslot |
Returns the size hint of the widget.
Returns the MDL tree for this control.
void MLABWidgetControl::updateLayout |
( |
| ) |
|
|
slot |
Recursively updates the layout.
You might need to call MLAB.processEvents() afterwards to make sure that the changes take effect completely.
void MLABWidgetControl::updateMaxSize |
( |
| ) |
|
|
slot |
Updates the maximum size of the widget when expandX/Y == no and the contents have changed size.
QWidget* MLABWidgetControl::widget |
( |
| ) |
|
|
inlineslot |
Returns the main QWidget of this control (this widget may be different depending on tags used in the control).
int MLABWidgetControl::width |
( |
| ) |
|
|
inlineslot |
Returns the width of the widget.
virtual QString MLABWidgetControl::windowHandle |
( |
| ) |
|
|
virtualslot |
Returns the window handle of the underlying QWidget as string encoded in hexadecimal, e.g., "1234ABCD".
int MLABWidgetControl::windowID |
( |
| ) |
|
|
inlineslot |
Returns the window id for this control.
The windowId can be used on MLABModule::controlForWindowID(id) to get a named control of a specific window.