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

Public Slots | |
void | setValue (double) |
void | setRelativeValue (double) |
void | setReferencePoint (double ref) |
void | setSuffix (const QString &suffix) |
void | setPrefix (const QString &prefix) |
Signals | |
void | valueChanged (double) |
void | relativeValueChanged (double) |
Public Member Functions | |
KDoubleNumInput (QWidget *parent=0, const char *name=0) | |
KDoubleNumInput (double value, QWidget *parent=0, const char *name=0) KDE_DEPRECATED | |
KDoubleNumInput (double lower, double upper, double value, double step=0.01, int precision=2, QWidget *parent=0, const char *name=0) | |
virtual | ~KDoubleNumInput () |
KDoubleNumInput (KNumInput *below, double value, QWidget *parent=0, const char *name=0) KDE_DEPRECATED | |
KDoubleNumInput (KNumInput *below, double lower, double upper, double value, double step=0.02, int precision=2, QWidget *parent=0, const char *name=0) | |
double | value () const |
QString | suffix () const |
QString | prefix () const |
int | precision () const |
QString | specialValueText () const |
void | setRange (double min, double max, double step=1, bool slider=true) |
void | setMinValue (double min) |
double | minValue () const |
void | setMaxValue (double max) |
double | maxValue () const |
void | setPrecision (int precision) |
double | referencePoint () const |
double | relativeValue () const |
void | setSpecialValueText (const QString &text) |
virtual void | setLabel (const QString &label, int a=AlignLeft|AlignTop) |
virtual QSize | minimumSizeHint () const |
virtual bool | eventFilter (QObject *, QEvent *) |
Protected Member Functions | |
virtual void | doLayout () |
void | resizeEvent (QResizeEvent *) |
virtual void | resetEditBox () |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
KDoubleLine * | edit |
bool | m_range |
double | m_lower |
double | m_upper |
double | m_step |
QSize | m_sizeEdit |
Properties | |
double | value |
double | minValue |
double | maxValue |
QString | suffix |
QString | prefix |
QString | specialValueText |
int | precision |
Detailed Description
KDoubleNumInput combines a QSpinBox and optionally a QSlider with a label to make an easy to use control for setting some float parameter. An input control for real 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 KDoubleNumInput, designed specifically for the situation when there are several instances 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 the KDoubleValidator validator class. KDoubleNumInput enforces the value to be in the given range, but see the class documentation of KDoubleSpinBox for the tricky interrelationship of precision and values. All of what is said there applies here, too.
- See also:
- KIntNumInput, KDoubleSpinBox
Definition at line 427 of file knuminput.h.
Constructor & Destructor Documentation
|
Constructs an input control for double values with initial value 0.00.
Definition at line 544 of file knuminput.cpp. References KDoubleNumInput(). Referenced by KDoubleNumInput(). |
|
Definition at line 567 of file knuminput.cpp. References KDoubleNumInput(). |
|
Constructor.
Definition at line 550 of file knuminput.cpp. References KDoubleNumInput(). |
|
destructor
Definition at line 580 of file knuminput.cpp. |
|
Definition at line 573 of file knuminput.cpp. References KDoubleNumInput(). |
|
Constructor. the difference here 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 558 of file knuminput.cpp. References KDoubleNumInput(). |
Member Function Documentation
|
Referenced by relativeValue(). |
|
|
|
|
|
|
|
Definition at line 540 of file knuminput.h. |
|
Definition at line 746 of file knuminput.cpp. References referencePoint(), setRange(), setReferencePoint(), setValue(), and valueChanged(). Referenced by setMaxValue(), setMinValue(), and setRange(). |
|
Sets the minimum value.
Definition at line 793 of file knuminput.cpp. References maxValue(), setMinValue(), and setRange(). Referenced by setMinValue(). |
|
Referenced by setMaxValue(), and setReferencePoint(). |
|
Sets the maximum value.
Definition at line 803 of file knuminput.cpp. References minValue(), setMaxValue(), and setRange(). Referenced by setMaxValue(). |
|
Referenced by setMinValue(), and setReferencePoint(). |
|
Specifies the number of digits to use.
Definition at line 853 of file knuminput.cpp. References setPrecision(). Referenced by setPrecision(). |
|
Definition at line 824 of file knuminput.cpp. Referenced by setRange(). |
|
Definition at line 818 of file knuminput.cpp. References value(). |
|
Sets the special value text. If set, the spin box 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 865 of file knuminput.cpp. References setSpecialValueText(). Referenced by setSpecialValueText(). |
|
Sets the text and alignment of the main description label.
Reimplemented from KNumInput. Definition at line 873 of file knuminput.cpp. References setLabel(). Referenced by setLabel(). |
|
Sets the value of the control.
Definition at line 726 of file knuminput.cpp. References setValue(). Referenced by setRange(), setRelativeValue(), and setValue(). |
|
Sets the value in units of referencePoint.
Definition at line 731 of file knuminput.cpp. References setRelativeValue(), and setValue(). Referenced by setRelativeValue(). |
|
Sets the reference Point to
It
Definition at line 739 of file knuminput.cpp. References maxValue(), minValue(), and setReferencePoint(). Referenced by setRange(), and setReferencePoint(). |
|
Sets the suffix to be displayed to Use QString::null to disable this feature. Note that the suffix is attached to the value without any spacing. So if you prefer to display a space separator, set suffix to something like " cm".
Definition at line 839 of file knuminput.cpp. References setSuffix(). Referenced by setSuffix(). |
|
Sets the prefix to be displayed to Use QString::null to disable this feature. Note that the prefix is attached to the value without any spacing.
Definition at line 846 of file knuminput.cpp. References setPrefix(). Referenced by setPrefix(). |
|
Emitted every time the value changes (by calling setValue() or by user interaction).
Referenced by setRange(). |
|
This is an overloaded member function, provided for convenience. It essentially behaves like the above function. Contains the value in units of 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 720 of file knuminput.cpp. |
The documentation for this class was generated from the following files: