KDoubleSpinBox Class Reference
This class provides a spin box for fractional numbers. A spin box for fractional numbers. More...
#include <knuminput.h>
Inheritance diagram for KDoubleSpinBox:


Public Slots | |
virtual void | setValue (double value) |
Sets the current value to value , cubject to the constraints that value is frist rounded to the current precision and then clipped to the interval [minvalue() ,maxValue() ]. | |
Signals | |
void | valueChanged (double value) |
Emitted whenever QSpinBox::valueChanged( int ) is emitted. | |
Public Member Functions | |
KDoubleSpinBox (QWidget *parent=0, const char *name=0) | |
Constructs a KDoubleSpinBox with parent parent and default values for range and value (whatever QRangeControl uses) and precision (2). | |
KDoubleSpinBox (double lower, double upper, double step, double value, int precision=2, QWidget *parent=0, const char *name=0) | |
Constructs a KDoubleSpinBox with parent parent , range [lower ,upper ], lineStep step , precision precision and initial value value . | |
bool | acceptLocalizedNumbers () const |
virtual void | setAcceptLocalizedNumbers (bool accept) |
Sets whether to use and accept localized numbers as returned by KLocale::formatNumber(). | |
void | setRange (double lower, double upper, double step=0.01, int precision=2) |
Sets a new range for the spin box values. | |
int | precision () const |
void | setPrecision (int precision) |
Equivalent to setPrecsion( precison , false ); Needed since Qt's moc doesn't ignore trailing parameters with default args when searching for a property setter method. | |
virtual void | setPrecision (int precision, bool force) |
Sets the number of decimal points to use. | |
double | value () const |
double | minValue () const |
void | setMinValue (double value) |
Sets the lower bound of the range to value , subject to the contraints that value is first rounded to the current precision and then clipped to the maximum representable interval. | |
double | maxValue () const |
void | setMaxValue (double value) |
Sets the upper bound of the range to value , subject to the contraints that value is first rounded to the current precision and then clipped to the maximum representable interval. | |
double | lineStep () const |
void | setLineStep (double step) |
Sets the step size for clicking the up/down buttons to step , subject to the constraints that step is first rounded to the current precision and then clipped to the meaningful interval [1, maxValue - minValue ]. | |
void | setValidator (const QValidator *) |
Overridden to ignore any setValidator() calls. | |
Protected Slots | |
void | slotValueChanged (int value) |
Protected Member Functions | |
virtual QString | mapValueToText (int) |
virtual int | mapTextToValue (bool *) |
virtual void | virtual_hook (int id, void *data) |
Detailed Description
This class provides a spin box for fractional numbers. A spin box for fractional numbers.Parameters
There are a number of interdependent parameters whose relation to each other you need to understand in order to make successful use of the spin box.
Since we work with fixed-point numbers internally, the maximum precision is a function of the valid range and vice versa. More precisely, the following relations hold:
Since the value, bounds and step are rounded to the current precision, you may experience that the order of setting above parameters matters. E.g. the following are not equivalent (try it!):
Definition at line 834 of file knuminput.h.
Constructor & Destructor Documentation
|
Constructs a KDoubleSpinBox with parent
Definition at line 912 of file knuminput.cpp. References QSpinBox::editor(), and KStdAccel::name(). |
|
Constructs a KDoubleSpinBox with parent
Definition at line 920 of file knuminput.cpp. References QSpinBox::editor(), KStdAccel::name(), setRange(), setValue(), and valueChanged(). |
Member Function Documentation
|
Definition at line 936 of file knuminput.cpp. |
|
Sets whether to use and accept localized numbers as returned by KLocale::formatNumber().
Definition at line 942 of file knuminput.cpp. |
|
Sets a new range for the spin box values.
Note that Definition at line 947 of file knuminput.cpp. References setLineStep(), setMaxValue(), setMinValue(), and setPrecision(). Referenced by KDoubleSpinBox(). |
|
Definition at line 957 of file knuminput.cpp. |
|
Equivalent to setPrecsion(
Definition at line 961 of file knuminput.cpp. Referenced by setRange(). |
|
Sets the number of decimal points to use. Note that there is a tradeoff between the precision used and the available range of values. See the class docs for more.
Definition at line 965 of file knuminput.cpp. |
|
Reimplemented from QSpinBox. Definition at line 987 of file knuminput.cpp. Referenced by setValue(). |
|
Reimplemented from QSpinBox. Definition at line 1004 of file knuminput.cpp. Referenced by setLineStep(), and setValue(). |
|
Sets the lower bound of the range to
Definition at line 1008 of file knuminput.cpp. Referenced by setRange(). |
|
Reimplemented from QSpinBox. Definition at line 1017 of file knuminput.cpp. Referenced by setLineStep(), and setValue(). |
|
Sets the upper bound of the range to
Definition at line 1021 of file knuminput.cpp. Referenced by setRange(). |
|
Reimplemented from QSpinBox. Definition at line 1029 of file knuminput.cpp. |
|
Sets the step size for clicking the up/down buttons to
Definition at line 1033 of file knuminput.cpp. References maxValue(), and minValue(). Referenced by setRange(). |
|
Overridden to ignore any setValidator() calls.
Reimplemented from QSpinBox. Definition at line 1063 of file knuminput.cpp. |
|
Emitted whenever QSpinBox::valueChanged( int ) is emitted.
Referenced by KDoubleSpinBox(). |
|
Sets the current value to
Definition at line 991 of file knuminput.cpp. References maxValue(), minValue(), and value(). Referenced by KDoubleSpinBox(). |
The documentation for this class was generated from the following files: