|
|
KDoubleNumInput combines a QSpinBox and optionally a QSlider with a label to make an easy to use control for setting some float parameter. This is especially nice for configuration dialogs, which can have many such combinated controls.
A special feature of KDoubleNumInput, designed specifically for the situation when there are several KDoubleNumInputs 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 KDoubleValidator validator class. KDoubleNumInput enforces the value to be in the given range.
KDoubleNumInput (const QString& label, double lower, double upper, double step, double value, const QString& units, const char* format=0, bool slider = true, QWidget *parent=0, const char *name=0) |
Constructor
Parameters:
label | main label for the control |
lower | lower bound on range |
upper | upper bound on range |
step | step size for the QSlider |
value | initial value for the control |
units | the units for the control (can be empty or 0) |
slider | whether a slider should be added (default: true) |
format | how to display the value (sprintf() format string) |
parent | parent QWidget |
name | internal name for this widget |
KDoubleNumInput (double lower, double upper, double step, double value, QWidget* parent=0, const QString& label = QString::null, const QString& units = QString::null, bool slider = true, const char* format=0, const char* name = 0) |
overloaded constructor, provided for convenience
QSize minimumSize () |
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
QSize sizeHint () |
Returns a size which fits the contents of the control.
Returns: the preferred size necessary to show the control
void setValue (double) |
Sets the value of the control.
double value () |
Returns: the current value
void setSteps (double minor, double major) |
Sets the spacing of tockmarks for the slider.
Parameters:
minor | minor tickmark separation |
major | major tickmark separation |
void setLabelAlignment (int a) |
Sets the alignment of the main control label. The value label, including the specified units, is always centered under the slider.
Parameters:
a | one of AlignLeft, AlignCenter, AlignRight |
void setEditBoxSize (int frac) |
Sets the fraction of the controls width taken by the LineEdit-Field. 100-frac is taken by the slider (if exists).
Parameters:
frac | fraction (1..100) of width taken by LineEdit |
QSizePolicy sizePolicy () |
Specifies that this widget may stretch horizontally, but is fixed vertically (like QSpinBox itself)
void 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 setEnabled (bool) |
Sets the Widget enabled/disabled
Generated by: root@tantive.terraplex.com on Sun Feb 27 17:39:25 2000, using kdoc 2.0a33. |