Main Page Modules Namespace List Class Hierarchy Compound List File List Namespace Members Compound Members Related Pages
KIntNumInput Class Reference
An input widget for integer numbers, consisting of a spinbox and a slider.
More...
#include <knuminput.h>
Inheritance diagram for KIntNumInput:
List of all members.
|
Public Slots |
| void | setValue (int) |
| void | setRelativeValue (double) |
| void | setReferencePoint (int) |
| void | setSuffix (const QString &suffix) |
| void | setPrefix (const QString &prefix) |
| void | setEditFocus (bool mark=true) |
Signals |
| void | valueChanged (int) |
| void | relativeValueChanged (double) |
Public Methods |
| | KIntNumInput (QWidget *parent=0, const char *name=0) |
| | KIntNumInput (int value, QWidget *parent=0, int base=10, const char *name=0) |
| | KIntNumInput (KNumInput *below, int value, QWidget *parent=0, int base=10, const char *name=0) |
| virtual | ~KIntNumInput () |
| int | value () const |
| double | relativeValue () const |
| int | referencePoint () const |
| QString | suffix () const |
| QString | prefix () const |
| QString | specialValueText () const |
| void | setRange (int min, int max, int step=1, bool slider=true) |
| void | setMinValue (int min) |
| int | minValue () const |
| void | setMaxValue (int max) |
| int | maxValue () const |
| void | setSpecialValueText (const QString &text) |
| virtual void | setLabel (const QString &label, int a=AlignLeft|AlignTop) |
| virtual QSize | minimumSizeHint () const |
Protected Methods |
| virtual void | doLayout () |
| void | resizeEvent (QResizeEvent *) |
|
virtual void | virtual_hook (int id, void *data) |
Detailed Description
An input widget for integer numbers, consisting of a spinbox and a slider.
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.
The slider is created only when the user specifies a range for the control using the setRange function with the slider parameter set to "true".
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.
- Version:
-
- Id:
-
knuminput.h,v 1.44 2002/09/28 15:16:22 tjansen Exp
Definition at line 181 of file knuminput.h.
Constructor & Destructor Documentation
| KIntNumInput::KIntNumInput |
( |
QWidget * |
parent = 0, |
|
|
const char * |
name = 0 |
|
) |
|
|
|
|
Constructs an input control for integer values with base 10 and initial value 0. |
| KIntNumInput::KIntNumInput |
( |
int |
value, |
|
|
QWidget * |
parent = 0, |
|
|
int |
base = 10, |
|
|
const char * |
name = 0 |
|
) |
|
|
|
|
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 |
|
| KIntNumInput::KIntNumInput |
( |
KNumInput * |
below, |
|
|
int |
value, |
|
|
QWidget * |
parent = 0, |
|
|
int |
base = 10, |
|
|
const char * |
name = 0 |
|
) |
|
|
|
|
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 KIntNumInput::~KIntNumInput |
( |
|
) |
[virtual] |
|
Member Function Documentation
| virtual void KIntNumInput::doLayout |
( |
|
) |
[protected, virtual] |
|
| int KIntNumInput::maxValue |
( |
|
) |
|
|
|
|
- Returns:
-
the maximum value.
|
| virtual QSize KIntNumInput::minimumSizeHint |
( |
|
) |
[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 KIntNumInput::minValue |
( |
|
) |
|
|
|
|
- Returns:
-
the minimum value.
|
| QString KIntNumInput::prefix |
( |
|
) |
|
|
|
|
- Returns:
-
the prefix displayed in front of the value.
- See also:
-
setPrefix()
|
| int KIntNumInput::referencePoint |
( |
|
) |
|
|
|
|
- Returns:
-
the current reference point
- Since:
-
3.1
|
| double KIntNumInput::relativeValue |
( |
|
) |
|
|
| void KIntNumInput::relativeValueChanged |
( |
double |
|
) |
[signal] |
|
| void KIntNumInput::resizeEvent |
( |
QResizeEvent * |
|
) |
[protected] |
|
| void KIntNumInput::setEditFocus |
( |
bool |
mark = true |
) |
[slot] |
|
|
|
sets focus to the edit widget and marks all text in if mark == true |
| virtual void KIntNumInput::setLabel |
( |
const QString & |
label, |
|
|
int |
a = AlignLeft|AlignTop |
|
) |
[virtual] |
|
| void KIntNumInput::setMaxValue |
( |
int |
max |
) |
|
|
| void KIntNumInput::setMinValue |
( |
int |
min |
) |
|
|
| void KIntNumInput::setPrefix |
( |
const QString & |
prefix |
) |
[slot] |
|
|
|
Sets the prefix to prefix. Use QString::null to disable this feature. Formatting has to be provided (see above).
- See also:
-
QSpinBox::setPrefix(), setSuffix()
|
| void KIntNumInput::setRange |
( |
int |
min, |
|
|
int |
max, |
|
|
int |
step = 1, |
|
|
bool |
slider = true |
|
) |
|
|
|
|
- Parameters:
-
| min |
minimum value |
| max |
maximum value |
| step |
step size for the QSlider |
|
| void KIntNumInput::setReferencePoint |
( |
int |
|
) |
[slot] |
|
| void KIntNumInput::setRelativeValue |
( |
double |
|
) |
[slot] |
|
| void KIntNumInput::setSpecialValueText |
( |
const QString & |
text |
) |
|
|
|
|
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 KIntNumInput::setSuffix |
( |
const QString & |
suffix |
) |
[slot] |
|
|
|
Sets the suffix to suffix. Use QString::null to disable this feature. Formatting has to be provided (e.g. a space separator between the prepended value and the suffix's text has to be provided as the first character in the suffix).
- See also:
-
QSpinBox::setSuffix(), setPrefix()
|
| void KIntNumInput::setValue |
( |
int |
|
) |
[slot] |
|
|
|
Sets the value of the control. |
| QString KIntNumInput::specialValueText |
( |
|
) |
|
|
| QString KIntNumInput::suffix |
( |
|
) |
|
|
|
|
- Returns:
-
the suffix displayed behind the value.
- See also:
-
setSuffix()
|
| int KIntNumInput::value |
( |
|
) |
|
|
|
|
- Returns:
-
the current value.
|
| void KIntNumInput::valueChanged |
( |
int |
|
) |
[signal] |
|
|
|
Emitted every time the value changes (by calling setValue() or by user interaction). |
The documentation for this class was generated from the following file:
Generated on Wed Aug 13 23:30:16 2003 for kdelibs by
1.2.18