|
SHAPER
9.15.0
|
An extension of a double spin box which let to use parameters and expressions for value definition. More...

Public Member Functions | |
| ModuleBase_ParamIntSpinBox (QWidget *theParent=0) | |
| Constructor. More... | |
| virtual | ~ModuleBase_ParamIntSpinBox () |
| Destructor. More... | |
| virtual void | stepBy (int) |
| Perform steps increment/decrement steps. More... | |
| virtual int | valueFromText (const QString &) const |
| Convert Int value from text string. More... | |
| virtual QString | textFromValue (int) const |
| Convert text string from int value. More... | |
| virtual QValidator::State | validate (QString &, int &) const |
| Validate the value. More... | |
| virtual void | setValue (int) |
| Set current int value. More... | |
| virtual void | setText (const QString &) |
| Set current text value. More... | |
| void | setAcceptVariables (const bool) |
| Set a flag about accepted variable. More... | |
| bool | isAcceptVariables () const |
| Returns accepted variables flag. More... | |
| bool | hasVariable () const |
| Returns True if the input value contains variable. More... | |
Protected Slots | |
| void | onTextChanged (const QString &) |
| A slot called on text change. More... | |
Protected Member Functions | |
| bool | hasVariable (const QString &theText) const |
| Returns True if the given text contains variable. More... | |
| State | isValid (const QString &, double &) const |
| Returns state of the control. More... | |
| bool | checkRange (const double) const |
| Returns True if the given value is within min and max of the control. More... | |
| bool | findVariable (const QString &theName, double &outValue) const |
| Finds a variable by its name. More... | |
| virtual void | showEvent (QShowEvent *) |
| This function is called when the spinbox receives show event. More... | |
| virtual void | keyPressEvent (QKeyEvent *theEvent) |
| Called on key press event. More... | |
An extension of a double spin box which let to use parameters and expressions for value definition.
|
explicit |
Constructor.
Constructs a spin box with 0.0 as minimum value and 99.99 as maximum value, a step value of 1.0 and a precision of 2 decimal places. The value is initially set to 0.00.
| theParent | a parent object |
|
virtual |
Destructor.
|
virtual |
Perform steps increment/decrement steps.
Re-implemented to handle cases when Notebook variable name is specified by the user as the widget text. Otherwise, simply calls the base implementation.
| steps | number of increment/decrement steps |
|
virtual |
Convert Int value from text string.
|
virtual |
Convert text string from int value.
|
virtual |
Validate the value.
This function is used to determine whether input is valid.
| str | currently entered value |
| pos | cursor position in the string |
|
virtual |
Set current int value.
This function is used to set a current value for this spinbox.
| value | current value |
The new value is ignored if the spinbox has a variable.
|
virtual |
Set current text value.
This function is used to set a text for this spinbox.
| value | current value |
| void ModuleBase_ParamIntSpinBox::setAcceptVariables | ( | const bool | flag | ) |
Set a flag about accepted variable.
Enables or disables variable names in the spin box. By default, variable names are enabled.
| flag | If true, variable names are enabled. |
| bool ModuleBase_ParamIntSpinBox::isAcceptVariables | ( | ) | const |
Returns accepted variables flag.
Returns true if the spin box accepts variable names.
| bool ModuleBase_ParamIntSpinBox::hasVariable | ( | ) | const |
Returns True if the input value contains variable.
|
protected |
Returns True if the given text contains variable.
| theText | a text string |
|
protected |
Returns state of the control.
This function is used to determine whether input is valid.
|
protected |
Returns True if the given value is within min and max of the control.
This function is used to check that string value lies within predefined range.
|
protected |
Finds a variable by its name.
This function is used to determine whether input is a variable name and to get its value.
Returns true in success
| theName | a name of variable |
| outValue | an output value of the variable |
|
protectedvirtual |
This function is called when the spinbox receives show event.
|
protectedslot |
A slot called on text change.
|
protectedvirtualinherited |
Called on key press event.