.TH "KDoubleNumInput" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KDoubleNumInput \- An input control for real numbers, consisting of a spinbox and a slider.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <knuminput.h>\fP
.PP
Inherits \fBKNumInput\fP.
.PP
.SS "Public Slots"

.in +1c
.ti -1c
.RI "void \fBsetValue\fP (double)"
.br
.ti -1c
.RI "void \fBsetRelativeValue\fP (double)"
.br
.ti -1c
.RI "void \fBsetReferencePoint\fP (double ref)"
.br
.ti -1c
.RI "void \fBsetSuffix\fP (const \fBQString\fP &suffix)"
.br
.ti -1c
.RI "void \fBsetPrefix\fP (const \fBQString\fP &prefix)"
.br
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBvalueChanged\fP (double)"
.br
.ti -1c
.RI "void \fBrelativeValueChanged\fP (double)"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKDoubleNumInput\fP (\fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "\fBKDoubleNumInput\fP (double value, \fBQWidget\fP *parent=0, const char *name=0) KDE_DEPRECATED"
.br
.ti -1c
.RI "\fBKDoubleNumInput\fP (double \fBlower\fP, double upper, double value, double step=0.01, int precision=2, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "virtual \fB~KDoubleNumInput\fP ()"
.br
.ti -1c
.RI "\fBKDoubleNumInput\fP (\fBKNumInput\fP *below, double value, \fBQWidget\fP *parent=0, const char *name=0) KDE_DEPRECATED"
.br
.ti -1c
.RI "\fBKDoubleNumInput\fP (\fBKNumInput\fP *below, double \fBlower\fP, double upper, double value, double step=0.02, int precision=2, \fBQWidget\fP *parent=0, const char *name=0)"
.br
.ti -1c
.RI "double \fBvalue\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBsuffix\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBprefix\fP () const "
.br
.ti -1c
.RI "int \fBprecision\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBspecialValueText\fP () const "
.br
.ti -1c
.RI "void \fBsetRange\fP (double min, double max, double step=1, bool slider=true)"
.br
.ti -1c
.RI "void \fBsetMinValue\fP (double min)"
.br
.ti -1c
.RI "double \fBminValue\fP () const "
.br
.ti -1c
.RI "void \fBsetMaxValue\fP (double max)"
.br
.ti -1c
.RI "double \fBmaxValue\fP () const "
.br
.ti -1c
.RI "void \fBsetPrecision\fP (int precision)"
.br
.ti -1c
.RI "double \fBreferencePoint\fP () const "
.br
.ti -1c
.RI "double \fBrelativeValue\fP () const "
.br
.ti -1c
.RI "void \fBsetSpecialValueText\fP (const \fBQString\fP &text)"
.br
.ti -1c
.RI "virtual void \fBsetLabel\fP (const \fBQString\fP &label, int a=AlignLeft|AlignTop)"
.br
.ti -1c
.RI "virtual \fBQSize\fP \fBminimumSizeHint\fP () const "
.br
.ti -1c
.RI "virtual bool \fBeventFilter\fP (\fBQObject\fP *, \fBQEvent\fP *)"
.br
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "virtual void \fBdoLayout\fP ()"
.br
.ti -1c
.RI "void \fBresizeEvent\fP (\fBQResizeEvent\fP *)"
.br
.ti -1c
.RI "virtual void \fBresetEditBox\fP ()"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "KDoubleLine * \fBedit\fP"
.br
.ti -1c
.RI "bool \fBm_range\fP"
.br
.ti -1c
.RI "double \fBm_lower\fP"
.br
.ti -1c
.RI "double \fBm_upper\fP"
.br
.ti -1c
.RI "double \fBm_step\fP"
.br
.ti -1c
.RI "\fBQSize\fP \fBm_sizeEdit\fP"
.br
.in -1c
.SS "Properties"

.in +1c
.ti -1c
.RI "double \fBvalue\fP"
.br
.ti -1c
.RI "double \fBminValue\fP"
.br
.ti -1c
.RI "double \fBmaxValue\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBsuffix\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBprefix\fP"
.br
.ti -1c
.RI "\fBQString\fP \fBspecialValueText\fP"
.br
.ti -1c
.RI "int \fBprecision\fP"
.br
.ti -1c
.RI "double \fBreferencePoint\fP"
.br
.ti -1c
.RI "double \fBrelativeValue\fP"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKDoubleLine\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
An input control for real numbers, consisting of a spinbox and a slider. 

KDoubleNumInput combines a \fBQSpinBox\fP and optionally a \fBQSlider\fP 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.
.PP
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'.
.PP
A special feature of KDoubleNumInput, designed specifically for the situation when there are several instances in a column, is that you can specify what portion of the control is taken by the \fBQSpinBox\fP (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.
.PP
It uses the \fBKDoubleValidator\fP validator class. KDoubleNumInput enforces the value to be in the given range, but see the class documentation of \fBKDoubleSpinBox\fP for the tricky interrelationship of precision and values. All of what is said there applies here, too.
.PP
\fBSee also:\fP
.RS 4
\fBKIntNumInput\fP, \fBKDoubleSpinBox\fP 
.RE
.PP

.PP
Definition at line 432 of file knuminput.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KDoubleNumInput::KDoubleNumInput (\fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructs an input control for double values with initial value 0.00. 
.PP
Definition at line 544 of file knuminput.cpp.
.SS "KDoubleNumInput::KDoubleNumInput (double value, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
\fBDeprecated\fP
.RS 4
(value is rounded to a multiple of 1/100) Constructor 
.RE
.PP
\fBParameters:\fP
.RS 4
\fIvalue\fP initial value for the control 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP

.PP
Definition at line 567 of file knuminput.cpp.
.SS "KDoubleNumInput::KDoubleNumInput (double lower, double upper, double value, double step = \fC0.01\fP, int precision = \fC2\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructor. 
.PP
\fBParameters:\fP
.RS 4
\fIlower\fP lower boundary value 
.br
\fIupper\fP upper boundary value 
.br
\fIvalue\fP initial value for the control 
.br
\fIstep\fP step size to use for up/down arrow clicks 
.br
\fIprecision\fP number of digits after the decimal point 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 550 of file knuminput.cpp.
.SS "KDoubleNumInput::~\fBKDoubleNumInput\fP ()\fC [virtual]\fP"
.PP
destructor 
.PP
Definition at line 580 of file knuminput.cpp.
.SS "KDoubleNumInput::KDoubleNumInput (\fBKNumInput\fP * below, double value, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
\fBDeprecated\fP
.RS 4
(rounds \fCvalue\fP to a multiple of 1/100) Constructor 
.RE
.PP
puts it visually below other \fBKNumInput\fP
.PP
\fBParameters:\fP
.RS 4
\fIbelow\fP .br
\fIvalue\fP initial value for the control 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP

.PP
Definition at line 573 of file knuminput.cpp.
.SS "KDoubleNumInput::KDoubleNumInput (\fBKNumInput\fP * below, double lower, double upper, double value, double step = \fC0.02\fP, int precision = \fC2\fP, \fBQWidget\fP * parent = \fC0\fP, const char * name = \fC0\fP)"
.PP
Constructor. 
.PP
the difference here is the 'below' parameter. It tells this instance that it is visually put below some other \fBKNumInput\fP widget. Note that these two KNumInput's need not to have the same parent widget or be in the same layout group. The effect is that it'll adjust it's layout in correspondence with the layout of the other KNumInput's (you can build an arbitrary long chain).
.PP
\fBParameters:\fP
.RS 4
\fIbelow\fP append KDoubleNumInput to the KDoubleNumInput chain 
.br
\fIlower\fP lower boundary value 
.br
\fIupper\fP upper boundary value 
.br
\fIvalue\fP initial value for the control 
.br
\fIstep\fP step size to use for up/down arrow clicks 
.br
\fIprecision\fP number of digits after the decimal point 
.br
\fIparent\fP parent \fBQWidget\fP 
.br
\fIname\fP internal name for this widget 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 558 of file knuminput.cpp.
.SH "Member Function Documentation"
.PP 
.SS "double KDoubleNumInput::value () const"
.PP
\fBReturns:\fP
.RS 4
the current value. 
.RE
.PP

.SS "\fBQString\fP KDoubleNumInput::suffix () const"
.PP
\fBReturns:\fP
.RS 4
the suffix. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetSuffix()\fP 
.RE
.PP

.SS "\fBQString\fP KDoubleNumInput::prefix () const"
.PP
\fBReturns:\fP
.RS 4
the prefix. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetPrefix()\fP 
.RE
.PP

.SS "int KDoubleNumInput::precision () const"
.PP
\fBReturns:\fP
.RS 4
the precision. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetPrecision()\fP 
.RE
.PP

.SS "\fBQString\fP KDoubleNumInput::specialValueText () const\fC [inline]\fP"
.PP
\fBReturns:\fP
.RS 4
the string displayed for a special value. 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBsetSpecialValueText()\fP 
.RE
.PP

.PP
Definition at line 547 of file knuminput.h.
.SS "void KDoubleNumInput::setRange (double min, double max, double step = \fC1\fP, bool slider = \fCtrue\fP)"
.PP
\fBParameters:\fP
.RS 4
\fImin\fP minimum value 
.br
\fImax\fP maximum value 
.br
\fIstep\fP step size for the \fBQSlider\fP 
.br
\fIslider\fP whether the slider is created or not 
.RE
.PP

.PP
Definition at line 746 of file knuminput.cpp.
.PP
References QWidget::layout(), QSpinBox::lineStep(), QSpinBox::maxValue(), QSpinBox::minValue(), referencePoint(), QSlider::setLineStep(), QSlider::setRange(), setReferencePoint(), QSlider::setTickInterval(), QSlider::setTickmarks(), QSlider::setValue(), setValue(), QSpinBox::value(), and valueChanged().
.PP
Referenced by setMaxValue(), and setMinValue().
.SS "void KDoubleNumInput::setMinValue (double min)"
.PP
Sets the minimum value. 
.PP
Definition at line 793 of file knuminput.cpp.
.PP
References maxValue(), and setRange().
.SS "double KDoubleNumInput::minValue () const"
.PP
\fBReturns:\fP
.RS 4
the minimum value. 
.RE
.PP

.PP
Referenced by setMaxValue(), and setReferencePoint().
.SS "void KDoubleNumInput::setMaxValue (double max)"
.PP
Sets the maximum value. 
.PP
Definition at line 803 of file knuminput.cpp.
.PP
References minValue(), and setRange().
.SS "double KDoubleNumInput::maxValue () const"
.PP
\fBReturns:\fP
.RS 4
the maximum value. 
.RE
.PP

.PP
Referenced by setMinValue(), and setReferencePoint().
.SS "void KDoubleNumInput::setPrecision (int precision)"
.PP
Specifies the number of digits to use. 
.PP
Definition at line 853 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "double KDoubleNumInput::referencePoint () const"
.PP
\fBReturns:\fP
.RS 4
the reference point for relativeValue calculation 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Referenced by setRange().
.SS "double KDoubleNumInput::relativeValue () const"
.PP
\fBReturns:\fP
.RS 4
the current value in units of referencePoint. 
.RE
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.SS "void KDoubleNumInput::setSpecialValueText (const \fBQString\fP & text)"
.PP
Sets the special value text. 
.PP
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. 
.PP
Definition at line 865 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "void KDoubleNumInput::setLabel (const \fBQString\fP & label, int a = \fCAlignLeft|AlignTop\fP)\fC [virtual]\fP"
.PP
Sets the text and alignment of the main description label. 
.PP
\fBParameters:\fP
.RS 4
\fIlabel\fP The text of the label. Use QString::null to remove an existing one.
.br
\fIa\fP one of \fCAlignLeft\fP, \fCAlignHCenter\fP, YAlignRight and \fCAlignTop\fP, \fCAlignVCenter\fP, \fCAlignBottom\fP. default is \fCAlignLeft\fP | \fCAlignTop\fP.
.RE
.PP
The vertical alignment flags have special meaning with this widget:
.PP
.PD 0
.IP "\(bu" 2
\fCAlignTop\fP The label is placed above the edit/slider 
.IP "\(bu" 2
\fCAlignVCenter\fP The label is placed left beside the edit 
.IP "\(bu" 2
\fCAlignBottom\fP The label is placed below the edit/slider 
.PP

.PP
Reimplemented from \fBKNumInput\fP.
.PP
Definition at line 873 of file knuminput.cpp.
.PP
References QLabel::setBuddy(), and KNumInput::setLabel().
.SS "void KDoubleNumInput::setValue (double)\fC [slot]\fP"
.PP
Sets the value of the control. 
.PP
Definition at line 726 of file knuminput.cpp.
.PP
Referenced by setRange(), and setRelativeValue().
.SS "void KDoubleNumInput::setRelativeValue (double)\fC [slot]\fP"
.PP
Sets the value in units of referencePoint. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 731 of file knuminput.cpp.
.PP
References setValue().
.SS "void KDoubleNumInput::setReferencePoint (double ref)\fC [slot]\fP"
.PP
Sets the reference Point to \fCref\fP. 
.PP
It \fCref\fP == 0, emitting of relativeValueChanged is blocked and relativeValue just returns 0. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.PP
Definition at line 739 of file knuminput.cpp.
.PP
References maxValue(), and minValue().
.PP
Referenced by setRange().
.SS "void KDoubleNumInput::setSuffix (const \fBQString\fP & suffix)\fC [slot]\fP"
.PP
Sets the suffix to be displayed to \fCsuffix\fP. 
.PP
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'. 
.PP
\fBSee also:\fP
.RS 4
\fBsetSuffix()\fP 
.RE
.PP

.PP
Definition at line 839 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "void KDoubleNumInput::setPrefix (const \fBQString\fP & prefix)\fC [slot]\fP"
.PP
Sets the prefix to be displayed to \fCprefix\fP. 
.PP
Use QString::null to disable this feature. Note that the prefix is attached to the value without any spacing. 
.PP
\fBSee also:\fP
.RS 4
\fBsetPrefix()\fP 
.RE
.PP

.PP
Definition at line 846 of file knuminput.cpp.
.PP
References QWidget::layout().
.SS "void KDoubleNumInput::valueChanged (double)\fC [signal]\fP"
.PP
Emitted every time the value changes (by calling \fBsetValue()\fP or by user interaction). 
.PP
Referenced by setRange().
.SS "void KDoubleNumInput::relativeValueChanged (double)\fC [signal]\fP"
.PP
This is an overloaded member function, provided for convenience. 
.PP
It essentially behaves like the above function.
.PP
Contains the value in units of referencePoint. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP

.SS "void KDoubleNumInput::doLayout ()\fC [protected, virtual]\fP"
.PP
You need to overwrite this method and implement your layout calculations there. 
.PP
See \fBKIntNumInput::doLayout\fP and \fBKDoubleNumInput::doLayout\fP implementation for details. 
.PP
Implements \fBKNumInput\fP.
.PP
Definition at line 720 of file knuminput.cpp.
.PP
References QSize::width().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
