#include <SalomeApp_DoubleSpinBox.h>
Signals | |
void | textChanged (const QString &) |
Public Member Functions | |
SalomeApp_DoubleSpinBox (QWidget *=0) | |
Constructor. More... | |
SalomeApp_DoubleSpinBox (double, double, double=1, QWidget *=0) | |
Constructor. More... | |
SalomeApp_DoubleSpinBox (double, double, double, int, int, QWidget *=0, bool=true, bool=true) | |
Constructor. More... | |
virtual | ~SalomeApp_DoubleSpinBox () |
Destructor. More... | |
virtual void | stepBy (int) |
Perform steps increment/decrement steps. More... | |
virtual double | valueFromText (const QString &) const |
Interpret text entered by the user as a value. More... | |
virtual QString | textFromValue (double) 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 double) |
This function is used to set a default value for this spinbox. More... | |
virtual void | setRange (double, double) |
This function is used to set minimum and maximum values for this spinbox. More... | |
virtual void | setValue (double) |
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 QtxDoubleSpinBox | |
QtxDoubleSpinBox (QWidget *=0) | |
Constructor. More... | |
QtxDoubleSpinBox (double, double, double=1, QWidget *=0) | |
Constructor. More... | |
QtxDoubleSpinBox (double, double, double, int, int, QWidget *=0) | |
Constructor. More... | |
virtual | ~QtxDoubleSpinBox () |
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... | |
int | getPrecision () const |
Get precision value of the spin box. More... | |
void | setPrecision (const int) |
Set precision 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 QtxDoubleSpinBox | |
virtual void | onTextChanged (const QString &) |
Called when user enters the text in the spin box. More... | |
Protected Member Functions | |
State | isValid (const QString &, double &) const |
This function is used to determine whether input is valid. More... | |
double | defaultValue () const |
This function return a default acceptable value (commonly, 0.0). More... | |
bool | checkRange (const double) const |
This function is used to check that string value lies within predefined range. More... | |
SearchState | findVariable (const QString &, double &) 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... | |
Protected Member Functions inherited from QtxDoubleSpinBox | |
QString | removeTrailingZeroes (const QString &) const |
Return source string with removed leading and trailing zeros. 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 | |
double | myDefaultValue |
bool | myIsRangeSet |
double | myMinimum |
double | myMaximum |
QString | myCorrectValue |
QString | myTextValue |
bool | myAcceptNames |
bool | myShowTip |
|
private |
|
private |
SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox | ( | QWidget * | parent = 0 | ) |
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.
parent | parent object |
References connectSignalsAndSlots().
SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox | ( | double | min, |
double | max, | ||
double | step = 1 , |
||
QWidget * | parent = 0 |
||
) |
Constructs a spin box with specified minimum, maximum and step value. The precision is set to 2 decimal places. 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 |
References connectSignalsAndSlots().
SalomeApp_DoubleSpinBox::SalomeApp_DoubleSpinBox | ( | double | min, |
double | max, | ||
double | step, | ||
int | prec, | ||
int | dec, | ||
QWidget * | parent = 0 , |
||
bool | acceptNames = true , |
||
bool | showTip = true |
||
) |
Constructs a spin box with specified minimum, maximum and step value. The precision is set to 2 decimal places. 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 |
References myIsRangeSet, myMaximum, and myMinimum.
|
private |
References onEditingFinished(), onTextChanged(), and textChanged().
|
protected |
References myDefaultValue, myMaximum, and myMinimum.
|
protected |
References _PTR(), app, Found, IncorrectType, NotFound, and SUIT_Session::session().
bool SalomeApp_DoubleSpinBox::isAcceptNames | ( | ) | const |
References myAcceptNames.
bool SalomeApp_DoubleSpinBox::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_DoubleSpinBox::setAcceptNames | ( | const bool | flag | ) |
flag | If true, variable names are enabled. |
References myAcceptNames.
|
virtual |
value | default value |
References myDefaultValue.
|
virtual |
min | minimum value |
max | maximum value |
References myIsRangeSet, myMaximum, and myMinimum.
void SalomeApp_DoubleSpinBox::setShowTipOnValidate | ( | const bool | flag | ) |
flag | If true, tooltips are enabled. |
References myShowTip.
|
virtual |
value | current value |
|
virtual |
value | current value |
References myCorrectValue, myTextValue, and QtxDoubleSpinBox::textFromValue().
|
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 QtxDoubleSpinBox.
References QtxDoubleSpinBox::stepBy().
|
signal |
|
virtual |
val | spin box value |
Reimplemented from QtxDoubleSpinBox.
References QtxDoubleSpinBox::textFromValue().
|
virtual |
str | currently entered value |
pos | cursor position in the string |
Reimplemented from QtxDoubleSpinBox.
References QtxDoubleSpinBox::getPrecision(), isAcceptNames(), isShowTipOnValidate(), textFromValue(), and QtxDoubleSpinBox::validate().
|
virtual |
text | text entered by the user |
Reimplemented from QtxDoubleSpinBox.
References Acceptable, defaultValue(), and isValid().
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |