#include <varinstance.h>
Signals | |
| void | varElementChanged () |
Public Member Functions | |
| VarInstance (const QString &name, CmdParam *cmdParam=NULL, bool autoInitElements=true) | |
| VarInstance (const QString &name, CmdParam *cmdParam, const QStringList &elementValues) | |
| const QString & | varName () const |
| CmdParam * | cmdParam () |
| const QStringList & | elementValues () const |
| const QString & | elementTypeName () const |
| void | setVarName (const QString &name) |
| void | setCmdParam (CmdParam *cmdParam, bool autoInitElements=true) |
| void | setElementValues (const QStringList &values) |
| void | initElementValues () |
| QString | toString () const |
| QHBox * | createEditorWidget (QWidget *parent) |
| QHBox * | getEditorWidget () |
| void | updateEditorWidget () |
| void | setEditorBackgroundColour (const QColor &colour) |
Private Slots | |
| void | editorWidgetCleanup () |
| void | elementValueChanged () |
Private Member Functions | |
| void | sharedInit () |
Private Attributes | |
| QString | myVarName |
| CmdParam * | myCmdParam |
| QStringList | myElementValues |
| QString | myElementTypeName |
| QHBox * | varEditorBox |
| QLabel * | varFrontLabel |
| QLabel * | varEndLabel |
| QPtrList< QWidget > | varElementWidgets |
Arrays are supported, as it uses a string list for the elements.
Note: Currently, only ARRAYS are supported, as they are the only type of variable needed by Glitch (currently).
Note: Arrays of arrays are NOT supported.
Note: There is a QtMac (Q_OS_MACX) specific section in the VarInstance::setEditorBackgroundColour() method.
Assumption: All of the elements in extVarElements of myCmdParam (set by either VarInstance::VarInstance() or VarInstance::setCmdParam() MUST be of the same type!
|
||||||||||||||||
|
Constructor. Allows you to create a variable instance that can set the element values to their defaults. |
|
||||||||||||||||
|
Constructor. Allows you to create a variable instance, where the element values are set as specified by the elementValues parameter. Note: if |elementValues| != |elements|, then the elementValues parameter will be ignored and the element values will be set to their defaults. |
|
|
|
|
|
Create an editor widget (which is a QHBox), which can be used to edit the elements of the variable instance. |
|
|
This method cleans up this command instance when it editor is destroyed. This is called by cmdEditorBox's destroyed signal. |
|
|
|
|
|
Called when one of the element input widget's value is changed. It also emits the VarInstance::varElementChanged() signal just before it returns. |
|
|
|
|
|
|
|
|
Initialize the elements to the defaults that are specified by the command parameter. If myCmdParam is NULL, then this will NOT do anything. |
|
||||||||||||
|
Set the command parameter that this variable instance is being used for. Note: This will return straight away if cmd = 0. |
|
|
Set the background colour of the editor, that is if it is active. Note: There is a QtMac (Q_OS_MACX) specific section in this method. It is used to set colours appropiately for specific widgets. |
|
|
Set the value(s) of the element(s) in this variable instance. This ensures that the correct string representation is used for the values. If myCmdParam == NULL, then this will return without doing anything. |
|
|
|
|
|
Shared initializer for the class. This method contains code that must be performed by all constructors. |
|
|
Produces a string/text representation of the variable instance. |
|
|
This method is very useful, as it allows an update in the name of the instance to be refected by the editor... if it exists. If varEditorBox == NULL, then this method returns without doing anything. Note: Currently, only the element type name and variable name are actualy updated by this method. The reason for this is that they are the only two that NEEDED to be updated (by an external object) in Glitch. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.2