class KDoubleNumInput

KDoubleNumInput combines a QSpinBox and optionally a QSlider with a label to make an easy to use control for setting some float parameter. More...

Definition#include <knuminput.h>
InheritsQWidget (qk)
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Signals

Protected Methods

Protected Slots

Protected Members


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. 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:
labelmain label for the control
lowerlower bound on range
upperupper bound on range
stepstep size for the QSlider
valueinitial value for the control
unitsthe units for the control (can be empty or 0)
sliderwhether a slider should be added (default: true)
formathow to display the value (sprintf() format string)
parentparent QWidget
nameinternal 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 ()
[const virtual]

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 ()
[const virtual]

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:
minorminor tickmark separation
majormajor 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:
aone 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:
fracfraction (1..100) of width taken by LineEdit

QSizePolicy sizePolicy ()
[const]

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.