#include <SalomeApp_IntSpinBox.h>

Signals | |
| void | textChanged (const QString &) |
Public Member Functions | |
| SalomeApp_IntSpinBox (QWidget *=0) | |
| Constructor. | |
| SalomeApp_IntSpinBox (int, int, int=1, QWidget *=0, bool=true, bool=true) | |
| Constructor. | |
| virtual | ~SalomeApp_IntSpinBox () |
| Destructor. | |
| virtual void | stepBy (int) |
| Perform steps increment/decrement steps. | |
| virtual int | valueFromText (const QString &) const |
| Interpret text entered by the user as a value. | |
| virtual QString | textFromValue (int) const |
| This function is used by the spin box whenever it needs to display the given value. | |
| virtual QValidator::State | validate (QString &, int &) const |
| This function is used to determine whether input is valid. | |
| virtual bool | isValid (QString &msg, bool=false) |
| This function is used to determine whether input is valid. | |
| virtual void | setDefaultValue (const int) |
| This function is used to set a default value for this spinbox. | |
| virtual void | setValue (int) |
| This function is used to set a current value for this spinbox. | |
| virtual void | setText (const QString &) |
| This function is used to set a text for this spinbox. | |
| void | setAcceptNames (const bool) |
| Enables or disables variable names in the spin box. By default, variable names are enabled. | |
| bool | isAcceptNames () const |
| Returns true if the spin box accepts variable names. | |
| void | setShowTipOnValidate (const bool) |
| Enables or disables tooltips in case of invalid or intermediate-state input. Tooltips are enabled by default. | |
| bool | isShowTipOnValidate () const |
| Returns true if tooltip should be shown in case of invalid or intermediate-state input. | |
| bool | isCleared () const |
| Check if spin box is in the "cleared" state. | |
| virtual void | setCleared (const bool) |
| Change "cleared" status of the spin box. | |
Protected Slots | |
| void | onEditingFinished () |
| This function is called when editing is finished. | |
| void | onTextChanged (const QString &) |
| This function is called when value is changed. | |
Protected Member Functions | |
| State | isValid (const QString &, int &) const |
| This function is used to determine whether input is valid. | |
| int | defaultValue () const |
| This function return a default acceptable value (commonly, 0). | |
| bool | checkRange (const int) const |
| This function is used to check that string value lies within predefined range. | |
| SearchState | findVariable (const QString &, int &) const |
| This function is used to determine whether input is a variable name and to get its value. | |
| virtual void | keyPressEvent (QKeyEvent *) |
| This function is called when the spinbox recieves key press event. | |
| virtual void | showEvent (QShowEvent *) |
| This function is called when the spinbox recieves show event. | |
Private Types | |
| enum | State { Invalid = 0, NoVariable, Incompatible, Acceptable } |
| enum | SearchState { NotFound = 0, IncorrectType, Found } |
Private Member Functions | |
| void | connectSignalsAndSlots () |
| Connect signals and slots. | |
Private Attributes | |
| int | myDefaultValue |
| QString | myCorrectValue |
| QString | myTextValue |
| bool | myAcceptNames |
| bool | myShowTip |
enum SalomeApp_IntSpinBox::State [private] |
enum SalomeApp_IntSpinBox::SearchState [private] |
| SalomeApp_IntSpinBox::SalomeApp_IntSpinBox | ( | QWidget * | parent = 0 | ) |
Constructs a spin box with 0 as minimum value and 99 as maximum value, a step value of 1. The value is initially set to 0.
| parent | parent object |
References connectSignalsAndSlots().
| SalomeApp_IntSpinBox::SalomeApp_IntSpinBox | ( | int | min, |
| int | max, | ||
| int | step = 1, |
||
| QWidget * | parent = 0, |
||
| bool | acceptNames = true, |
||
| bool | showTip = true |
||
| ) |
Constructs a spin box with specified minimum, maximum and step value. The value is initially set to the minimum value.
| min | spin box minimum possible value |
| max | spin box maximum possible value |
| step | spin box increment/decrement value |
| parent | parent object |
| acceptNames | if true, enables variable names in the spin box |
| showTip | if true, makes the widget show a tooltip when invalid text is entered by the user |
References connectSignalsAndSlots().
| SalomeApp_IntSpinBox::~SalomeApp_IntSpinBox | ( | ) | [virtual] |
| void SalomeApp_IntSpinBox::stepBy | ( | int | steps | ) | [virtual] |
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 |
Reimplemented from QtxIntSpinBox.
| int SalomeApp_IntSpinBox::valueFromText | ( | const QString & | text | ) | const [virtual] |
| text | text entered by the user |
References Acceptable, defaultValue(), and isValid().
| QString SalomeApp_IntSpinBox::textFromValue | ( | int | val | ) | const [virtual] |
| val | spin box value |
Reimplemented from QtxIntSpinBox.
| QValidator::State SalomeApp_IntSpinBox::validate | ( | QString & | str, |
| int & | pos | ||
| ) | const [virtual] |
| str | currently entered value |
| pos | cursor position in the string |
References Invalid, isAcceptNames(), isShowTipOnValidate(), and textFromValue().
| bool SalomeApp_IntSpinBox::isValid | ( | QString & | msg, |
| bool | toCorrect = false |
||
| ) | [virtual] |
References Acceptable, Incompatible, Invalid, myCorrectValue, NoVariable, and setText().
| void SalomeApp_IntSpinBox::setDefaultValue | ( | const int | value | ) | [virtual] |
| value | default value |
References myDefaultValue.
| void SalomeApp_IntSpinBox::setValue | ( | int | value | ) | [virtual] |
| value | current value |
References myCorrectValue, and myTextValue.
| void SalomeApp_IntSpinBox::setText | ( | const QString & | value | ) | [virtual] |
| value | current value |
| void SalomeApp_IntSpinBox::setAcceptNames | ( | const bool | flag | ) |
| flag | If true, variable names are enabled. |
References myAcceptNames.
| bool SalomeApp_IntSpinBox::isAcceptNames | ( | ) | const |
References myAcceptNames.
| void SalomeApp_IntSpinBox::setShowTipOnValidate | ( | const bool | flag | ) |
| flag | If true, tooltips are enabled. |
References myShowTip.
| bool SalomeApp_IntSpinBox::isShowTipOnValidate | ( | ) | const |
References myShowTip.
| void SalomeApp_IntSpinBox.textChanged | ( | const QString & | ) | [signal] |
| SalomeApp_IntSpinBox::State SalomeApp_IntSpinBox::isValid | ( | const QString & | text, |
| int & | value | ||
| ) | const [protected] |
References Acceptable, checkRange(), findVariable(), Incompatible, IncorrectType, Invalid, NotFound, and NoVariable.
| int SalomeApp_IntSpinBox::defaultValue | ( | ) | const [protected] |
References myDefaultValue.
| bool SalomeApp_IntSpinBox::checkRange | ( | const int | value | ) | const [protected] |
| SalomeApp_IntSpinBox::SearchState SalomeApp_IntSpinBox::findVariable | ( | const QString & | name, |
| int & | value | ||
| ) | const [protected] |
References _PTR(), test_big_table.aName, TestSalomeApp.command, Found, PyConsole_Console.getInterp(), PyInterp_Interp.GetLockWrapper(), IncorrectType, NotFound, PyInterp_Interp.run(), and SUIT_Session.session().
| void SalomeApp_IntSpinBox::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
| void SalomeApp_IntSpinBox::showEvent | ( | QShowEvent * | ) | [protected, virtual] |
References myTextValue, and setText().
| void SalomeApp_IntSpinBox::onEditingFinished | ( | ) | [protected, slot] |
References myTextValue, and setText().
| void SalomeApp_IntSpinBox::onTextChanged | ( | const QString & | text | ) | [protected, virtual, slot] |
Reimplemented from QtxIntSpinBox.
References Acceptable, isValid(), myCorrectValue, and myTextValue.
| void SalomeApp_IntSpinBox::connectSignalsAndSlots | ( | ) | [private] |
References onEditingFinished(), onTextChanged(), and textChanged().
| bool QtxIntSpinBox::isCleared | ( | ) | const [inherited] |
true if spin box is cleared References QtxIntSpinBox.myCleared.
| void QtxIntSpinBox::setCleared | ( | const bool | on | ) | [virtual, inherited] |
| on | new "cleared" status |
References QtxIntSpinBox.myCleared.
int SalomeApp_IntSpinBox.myDefaultValue [private] |
QString SalomeApp_IntSpinBox.myCorrectValue [private] |
QString SalomeApp_IntSpinBox.myTextValue [private] |
bool SalomeApp_IntSpinBox.myAcceptNames [private] |
bool SalomeApp_IntSpinBox.myShowTip [private] |