#include <superspinbox.h>
Public Slots | |
| virtual void | setValue (double value) |
| virtual void | stepUp () |
| virtual void | stepDown () |
Signals | |
| void | valueChanged (double value) |
| void | valueChanged (const QString &valueText) |
Public Member Functions | |
| SuperSpinBox (QWidget *parent=NULL, const char *name=NULL) | |
| SuperSpinBox (double minValue, double maxValue, double step=DEFAULT_STEP_VALUE, QWidget *parent=NULL, const char *name=NULL) | |
| double | value () const |
| double | minValue () const |
| double | maxValue () const |
| double | lineStep () const |
| void | setMinValue (double min) |
| void | setMaxValue (double max) |
| void | setLineStep (double step) |
Protected Member Functions | |
| virtual int | mapTextToValue (bool *ok) |
| virtual QString | mapValueToText (int) |
| virtual void | valueChange () |
| virtual void | rangeChange () |
Protected Attributes | |
| double | d_value |
| double | d_minValue |
| double | d_maxValue |
| double | d_lineStep |
Private Member Functions | |
| void | sharedInit () |
Private Attributes | |
| QDoubleValidator * | validator |
Benefits of this method of this approach: the widget looks and feels exactly like the normal integer spin box.
Note: Unlike QSpinBox, this reimplemention does NOT calculate the minimum width for the widget. Instead it will expdand to fill the entrie allocated area.
|
||||||||||||
|
Constructor. This will initialize the double's min, max and line step values to their defaults of 0.0, 99.0 and 1.0 (respectively). |
|
||||||||||||||||||||||||
|
Constructor. This constructor takes the double's min, max and line step values as parameters, instead of using defaults. |
|
|
|
|
|
Reimplemented as to get the lastest DOUBLE value from the editor widget. |
|
|
Map the value of the double value to its actual string representation. |
|
|
|
|
|
|
|
|
Reimplemented as to update the editor's validator and to enable/disable the up and down arrow buttons. |
|
|
Reimplemented as to update the double's line step (increment/decrement) value. |
|
|
Reimplemented as to update the double max value and the editor's validator. |
|
|
Reimplemented as to update the double min value and the editor's validator. |
|
|
Reimplemented as to update the double value and to update the editor widget. |
|
|
This method is used by the constructors to perform tasks that are common to all of them. |
|
|
Decrement the double value by d_lineStep and update the editor widget. |
|
|
Increment the double value by d_lineStep and update the editor widget. |
|
|
|
|
|
This looks after things that need to be updated when the value is changed. It will look after bounds checks and enabling / disabling the up and down buttons, update the text display and emit the SuperSpinBox::valueChanged() signals. Note: This does not call the parent's valueChange, as we don't want to emit the integer-based signals. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.2