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