class KDoubleNumInput

An input control for real numbers, consisting of a spinbox and a slider. More...

Definition#include <knuminput.h>
InheritsKNumInput
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Signals

Protected Methods

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.

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 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 (QWidget *parent=0, const char *name=0)

Constructs an input control for double values with initial value 0.0.

 KDoubleNumInput (double value, QWidget *parent=0, const char *name=0)

Constructor

Parameters:

KDoubleNumInput ()

[virtual]

destructor

 KDoubleNumInput (KNumInput* below, double value, QWidget* parent=0, const char* name=0)

Constructor

put it below other KNumInput

Parameters:

double  value ()

[const]

Returns: the current value.

QString  suffix ()

[const]

Returns: the suffix.

QString  prefix ()

[const]

Returns: the prefix.

const char * format ()

[const]

Returns: the format.

QString  specialValueText ()

[const]

Returns: the string displayed for a special value.

void  setRange (double lower, double upper, double step=1, bool slider=true)

Parameters:

void  setFormat (const char* format)

Sets the format string that should be used to display the double value. The format string follows the same rules as the printf() function or QString::sprintf(). You can use this if you want to set the number of digits to be displayed, etc.

void  setSpecialValueText (const QString& text)

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.

void  setLabel (QString label, int a = AlignLeft | AlignTop)

[virtual]

Reimplemented from KNumInput for internal reasons; the API is not affected.

QSize  minimumSizeHint ()

[const virtual]

bool  eventFilter (QObject*, QEvent*)

[virtual]

void  setValue (double)

[slot]

Sets the value of the control.

void  setSuffix (const QString &suffix)

[slot]

Sets the suffix to be displayed to suffix. 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".

void  setPrefix (const QString &prefix)

[slot]

Sets the prefix to be displayed to prefix. Use QString::null to disable this feature. Note that the prefix is attached to the value without any spacing.

void  valueChanged (double)

[signal]

Emitted every time the value changes (by calling setValue() or by user interaction).

void  doLayout ()

[protected virtual]

Reimplemented from KNumInput for internal reasons; the API is not affected.

void  resizeEvent ( QResizeEvent * )

[protected]

void  resetEditBox ()

[protected virtual]

KDoubleLine* edit

[protected]

bool m_range

[protected]

double m_lower

[protected]

double m_upper

[protected]

double m_step

[protected]

QSize m_sizeEdit

[protected]

friend class KDoubleLine

[protected]


Generated by: baudens@ke.mandrakesoft.com on Thu Oct 26 17:36:26 2000, using kdoc 2.0a40.