KIntNumInput Class Reference
KIntNumInput combines a QSpinBox and optionally a QSlider with a label to make an easy to use control for setting some integer parameter. An input widget for integer numbers, consisting of a spinbox and a slider. More...
#include <knuminput.h>
Inheritance diagram for KIntNumInput:

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 Member Functions | |
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 Member Functions | |
virtual void | doLayout () |
void | resizeEvent (QResizeEvent *) |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
KIntSpinBox * | m_spin |
QSize | m_sizeSpin |
Detailed Description
KIntNumInput combines a QSpinBox and optionally a QSlider with a label to make an easy to use control for setting some integer parameter. An input widget for integer numbers, consisting of a spinbox and a slider.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.

KDE Int Number Input Spinbox
- Version:
- Id
- knuminput.h,v 1.56 2003/10/07 22:53:26 mueller Exp
Definition at line 184 of file knuminput.h.
Constructor & Destructor Documentation
|
Constructs an input control for integer values with base 10 and initial value 0.
Definition at line 273 of file knuminput.cpp. |
|
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().
Definition at line 279 of file knuminput.cpp. |
|
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 arbitrary long chain).
Definition at line 266 of file knuminput.cpp. |
|
Destructor.
Definition at line 484 of file knuminput.cpp. |
Member Function Documentation
|
Definition at line 507 of file knuminput.cpp. Referenced by relativeValue(). |
|
Definition at line 502 of file knuminput.cpp. References value(). |
|
Definition at line 310 of file knuminput.cpp. Referenced by setRange(). |
|
Definition at line 393 of file knuminput.cpp. |
|
Definition at line 405 of file knuminput.cpp. |
|
Definition at line 518 of file knuminput.cpp. |
|
Definition at line 327 of file knuminput.cpp. References KNumInput::layout(), referencePoint(), setReferencePoint(), setValue(), and valueChanged(). Referenced by setMaxValue(), and setMinValue(). |
|
Sets the minimum value.
Definition at line 366 of file knuminput.cpp. References setRange(). Referenced by KFontChooser::KFontChooser(). |
|
Definition at line 371 of file knuminput.cpp. Referenced by setReferencePoint(). |
|
Sets the maximum value.
Definition at line 376 of file knuminput.cpp. References setRange(). |
|
Definition at line 381 of file knuminput.cpp. Referenced by setReferencePoint(). |
|
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. Definition at line 512 of file knuminput.cpp. References KNumInput::layout(). |
|
Sets the text and alignment of the main description label.
Reimplemented from KNumInput. Definition at line 523 of file knuminput.cpp. References KNumInput::setLabel(). |
|
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).
Definition at line 415 of file knuminput.cpp. |
|
Sets the value of the control.
Definition at line 489 of file knuminput.cpp. Referenced by setRange(), and setRelativeValue(). |
|
Sets the value in units of the referencePoint
Definition at line 495 of file knuminput.cpp. References setValue(). |
|
Sets the reference point for relativeValue.
Definition at line 304 of file knuminput.cpp. References maxValue(), and minValue(). Referenced by setRange(). |
|
Sets the suffix to
Use QString::null to disable this feature. Formatting has to be provided (e.g. a space separator between the prepended
Definition at line 386 of file knuminput.cpp. References KNumInput::layout(). |
|
Sets the prefix to Use QString::null to disable this feature. Formatting has to be provided (see above).
Definition at line 398 of file knuminput.cpp. References KNumInput::layout(). |
|
sets focus to the edit widget and marks all text in if mark == true
Definition at line 410 of file knuminput.cpp. References KIntSpinBox::setEditFocus(). |
|
Emitted every time the value changes (by calling setValue() or by user interaction).
Referenced by setRange(). |
|
Emitted whenever valueChanged is. Contains the change relative to the referencePoint.
|
|
You need to overwrite this method and implement your layout calculations there. See KIntNumInput::doLayout and KDoubleNumInput::doLayout implementation for details. Implements KNumInput. Definition at line 440 of file knuminput.cpp. |
The documentation for this class was generated from the following files: