Enhanced version of the Qt's spin box. More...
#include <QtxIntSpinBox.h>
Public Member Functions | |
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... | |
virtual void | stepBy (int) |
Perform steps increment/decrement steps. More... | |
Protected Slots | |
virtual void | onTextChanged (const QString &) |
Called when user enters the text in the spin box. More... | |
Protected Member Functions | |
virtual QString | textFromValue (int) const |
Convert value to the text. More... | |
Private Attributes | |
bool | myCleared |
The QtxIntSpinBox class represents the widget for entering the integer values. In addition to the functionality provided by QSpinBox, this class supports "cleared" state - this is the state corresponding to "None" (or empty) entered value.
To set "cleared" state use setCleared() method. To check if the spin box stores "cleared" state, use isCleared() method. For example:
QtxIntSpinBox::QtxIntSpinBox | ( | 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 onTextChanged().
QtxIntSpinBox::QtxIntSpinBox | ( | int | min, |
int | max, | ||
int | step = 1 , |
||
QWidget * | parent = 0 |
||
) |
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 |
References onTextChanged().
|
virtual |
bool QtxIntSpinBox::isCleared | ( | ) | const |
true
if spin box is cleared References myCleared.
|
protectedvirtualslot |
txt | current spin box text (not used) |
References myCleared.
|
virtual |
on | new "cleared" status |
References myCleared.
|
virtual |
The steps value can be any integer number. If it is > 0, the value incrementing is done, otherwise value is decremented steps times.
steps | number of increment/decrement steps |
Reimplemented in SalomeApp_IntSpinBox.
References myCleared.
|
protectedvirtual |
val | value being converted |
Reimplemented in SalomeApp_IntSpinBox.
References myCleared.
|
private |