An extension of a double spin box which let to use parameters and expressions for value definition.
More...
#include <ModuleBase_ParamIntSpinBox.h>
|
| 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.
◆ ModuleBase_ParamIntSpinBox()
| ModuleBase_ParamIntSpinBox::ModuleBase_ParamIntSpinBox |
( |
QWidget * |
theParent = 0 | ) |
|
|
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.
- Parameters
-
◆ ~ModuleBase_ParamIntSpinBox()
| ModuleBase_ParamIntSpinBox::~ModuleBase_ParamIntSpinBox |
( |
| ) |
|
|
virtual |
◆ stepBy()
| void ModuleBase_ParamIntSpinBox::stepBy |
( |
int |
steps | ) |
|
|
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.
- Parameters
-
| steps | number of increment/decrement steps |
◆ valueFromText()
| int ModuleBase_ParamIntSpinBox::valueFromText |
( |
const QString & |
theText | ) |
const |
|
virtual |
Convert Int value from text string.
◆ textFromValue()
| QString ModuleBase_ParamIntSpinBox::textFromValue |
( |
int |
theValue | ) |
const |
|
virtual |
Convert text string from int value.
◆ validate()
| QValidator::State ModuleBase_ParamIntSpinBox::validate |
( |
QString & |
str, |
|
|
int & |
pos |
|
) |
| const |
|
virtual |
Validate the value.
This function is used to determine whether input is valid.
- Parameters
-
| str | currently entered value |
| pos | cursor position in the string |
- Returns
- validating operation result
◆ setValue()
| void ModuleBase_ParamIntSpinBox::setValue |
( |
int |
value | ) |
|
|
virtual |
Set current int value.
This function is used to set a current value for this spinbox.
- Parameters
-
The new value is ignored if the spinbox has a variable.
◆ setText()
| void ModuleBase_ParamIntSpinBox::setText |
( |
const QString & |
value | ) |
|
|
virtual |
Set current text value.
This function is used to set a text for this spinbox.
- Parameters
-
◆ setAcceptVariables()
| 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.
- Parameters
-
| flag | If true, variable names are enabled. |
◆ isAcceptVariables()
| bool ModuleBase_ParamIntSpinBox::isAcceptVariables |
( |
| ) |
const |
Returns accepted variables flag.
Returns true if the spin box accepts variable names.
◆ hasVariable() [1/2]
| bool ModuleBase_ParamIntSpinBox::hasVariable |
( |
| ) |
const |
Returns True if the input value contains variable.
◆ hasVariable() [2/2]
| bool ModuleBase_ParamIntSpinBox::hasVariable |
( |
const QString & |
theText | ) |
const |
|
protected |
Returns True if the given text contains variable.
- Parameters
-
◆ isValid()
| ModuleBase_ParamIntSpinBox::State ModuleBase_ParamIntSpinBox::isValid |
( |
const QString & |
theText, |
|
|
double & |
theValue |
|
) |
| const |
|
protected |
Returns state of the control.
This function is used to determine whether input is valid.
- Returns
- validating operation result
◆ checkRange()
| bool ModuleBase_ParamIntSpinBox::checkRange |
( |
const double |
theValue | ) |
const |
|
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.
- Returns
- check status
◆ findVariable()
| bool ModuleBase_ParamIntSpinBox::findVariable |
( |
const QString & |
theName, |
|
|
double & |
outValue |
|
) |
| const |
|
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
- Parameters
-
| theName | a name of variable |
| outValue | an output value of the variable |
- Returns
- status of search operation
◆ showEvent()
| void ModuleBase_ParamIntSpinBox::showEvent |
( |
QShowEvent * |
theEvent | ) |
|
|
protectedvirtual |
This function is called when the spinbox receives show event.
◆ onTextChanged
| void ModuleBase_ParamIntSpinBox::onTextChanged |
( |
const QString & |
text | ) |
|
|
protectedslot |
A slot called on text change.
◆ keyPressEvent()
| void ModuleBase_IntSpinBox::keyPressEvent |
( |
QKeyEvent * |
theEvent | ) |
|
|
protectedvirtualinherited |
Called on key press event.