|
|
KIntNumInput combines a QSpinBox and optionally a QSlider with a label to make an easy to use control for setting some integer parameter. This is especially nice for configuration dialogs, which can have many such combinated controls.
A special feature of KIntNumInput, designed specifically for the situation when there are several KIntNumInputs in a column, is that you can specify what portion of the control is taken by the QSpinBox (the remaining portion is used by the slider). This makes it very simple to have all the sliders in a column be the same size.
It uses KIntValidator validator class. KIntNumInput enforces the value to be in the given range, and can display it in any base between 2 and 36.
|
Constructor It constructs a QSpinBox that allows the input of integer numbers in the range of -INT_MAX to +INT_MAX. To set a descriptive label, use setLabel(). To enforce the value being in a range and optionally to attach a slider to it, use setRange().
Parameters:
value | initial value for the control |
base | numeric base used for display |
parent | parent QWidget |
name | internal name for this widget |
|
Constructor
the difference to the one above is the "below" parameter. It tells this instance that it is visually put below some other KNumInput widget. Note that these two KNumInput's need not to have the same parent widget or be in the same layout group. The effect is that it'll adjust it's layout in correspondence with the layout of the other KNumInput's (you can build an arbitary long chain).
Parameters:
below | append KIntNumInput to the KNumInput chain |
value | initial value for the control |
base | numeric base used for display |
parent | parent QWidget |
name | internal name for this widget |
~ |
[virtual]
Destructor
QSize |
[const virtual]
This method returns the minimum size necessary to display the control. The minimum size is enough to show all the labels in the current font (font change may invalidate the return value).
Returns: the minimum size necessary to show the control
int |
[const]
Returns: the current value
void |
Parameters:
lower | lower bound on range |
upper | upper bound on range |
step | step size for the QSlider |
void |
Sets the special value text. If set, the SpinBox will display this text instead of the numeric value whenever the current value is equal to minVal(). Typically this is used for indicating that the choice has a special (default) meaning.
void |
[virtual]
reimplemented for internal reasons.
Reimplemented from KNumInput
void |
[slot]
Sets the value of the control.
void |
[slot]
sets the Suffix
Parameters:
suffix | the suffix that should be used. QString::null to disable |
void |
[slot]
sets the Prefix
Parameters:
prefix | the prefix that should be used. QString::null to disable |
void |
[slot]
sets focus to the edit widget and marks all text in if mark == true