Version: 8.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
QtxIntSpinBox Class Reference

Enhanced version of the Qt's spin box. More...

#include <QtxIntSpinBox.h>

Inheritance diagram for QtxIntSpinBox:
Inheritance graph

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
 

Detailed Description

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:

if (mySpinBox->isCleared()) {
... // process "None" state
}
else {
int value = mySpinBox->value();
... // process entered value
}

Constructor & Destructor Documentation

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.

Parameters
parentparent 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.

Parameters
minspin box minimum possible value
maxspin box maximum possible value
stepspin box increment/decrement value
parentparent object

References onTextChanged().

QtxIntSpinBox::~QtxIntSpinBox ( )
virtual

Member Function Documentation

bool QtxIntSpinBox::isCleared ( ) const
Returns
true if spin box is cleared

References myCleared.

void QtxIntSpinBox::onTextChanged ( const QString &  )
protectedvirtualslot
Parameters
txtcurrent spin box text (not used)

References myCleared.

void QtxIntSpinBox::setCleared ( const bool  on)
virtual
Parameters
onnew "cleared" status

References myCleared.

void QtxIntSpinBox::stepBy ( int  steps)
virtual

The steps value can be any integer number. If it is > 0, the value incrementing is done, otherwise value is decremented steps times.

Parameters
stepsnumber of increment/decrement steps

Reimplemented in SalomeApp_IntSpinBox.

References myCleared.

QString QtxIntSpinBox::textFromValue ( int  val) const
protectedvirtual
Parameters
valvalue being converted
Returns
string containing the converted value

Reimplemented in SalomeApp_IntSpinBox.

References myCleared.

Member Data Documentation

bool QtxIntSpinBox::myCleared
private

The documentation for this class was generated from the following files: