# class KDoubleNumInput

###

Module | kdeui
Namespace |
Class | KDoubleNumInput
Inherits | KNumInput

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

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 instances 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 the KDoubleValidator validator class. KDoubleNumInput enforces the value to be in the given range, but see the class documentation of KDoubleSpinBox for the tricky interrelationship of precision and values. All of what is said there applies here, too.

See also KIntNumInput, KDoubleSpinBox

### methods

- KDoubleNumInput (parent)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget | 0

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

- KDoubleNumInput (lower, upper, value, parent, step, precision)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  lower | double |
  upper | double |
  value | double |
  parent | QWidget | 0
  step | double | 0.01
  precision | int | 2

  Constructor

  lower - lower boundary value

  upper - upper boundary value

  value - initial value for the control

  step - step size to use for up/down arrow clicks

  precision - number of digits after the decimal point

  parent - parent QWidget

- KDoubleNumInput (below, lower, upper, value, parent, step, precision)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  below | KNumInput |
  lower | double |
  upper | double |
  value | double |
  parent | QWidget | 0
  step | double | 0.02
  precision | int | 2

  Constructor

  the difference here is the "below" parameter. It tells this instance that it is visually put below some other KNumInput 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 its layout in correspondence with the layout of the other KNumInput's (you can build an arbitrary long chain).

  below - append KDoubleNumInput to the KDoubleNumInput chain

  lower - lower boundary value

  upper - upper boundary value

  value - initial value for the control

  step - step size to use for up/down arrow clicks

  precision - number of digits after the decimal point

  parent - parent QWidget

  Deprecated use the version without below instead

- KDoubleNumInput (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KDoubleNumInput |

- KDoubleNumInput (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | QWidget | 0

- decimals ( )

  returns int

  Returns number of decimals.

  See also setDecimals()

- doLayout ( )

  returns Nothing

- maximum ( )

  returns double

  Returns the maximum value.

- minimum ( )

  returns double

  Returns the minimum value.

- minimumSizeHint ( )

  returns QSize

- prefix ( )

  returns QString

  Returns the prefix.

  See also setPrefix()

- referencePoint ( )

  returns double

  Returns the reference point for relativeValue calculation

- relativeValue ( )

  returns double

  Returns the current value in units of referencePoint.

- relativeValueChanged (a0)

  returns Nothing
  SIGNAL ("relativeValueChanged (double)")

  Argument | Type | Default
  --- | --- | ---
  a0 | double |

  This is an overloaded member function, provided for convenience. It essentially behaves like the above function.

  Contains the value in units of referencePoint.

- resizeEvent (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | QResizeEvent |

- setDecimals (decimals)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  decimals | int |

  Specifies the number of digits to use.

- setLabel (label, a)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  label | QString |
  a | Qt.Alignment | Qt.AlignLeft|Qt.AlignTop

- setMaximum (max)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  max | double |

  Sets the maximum value.

- setMinimum (min)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  min | double |

  Sets the minimum value.

- setPrecision (precision)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  precision | int |

- setPrefix (prefix)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  prefix | QString |

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

  See also setPrefix()

- setRange (min, max, step, slider)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  min | double |
  max | double |
  step | double | 1
  slider | bool | 1

  min - minimum value

  max - maximum value

  step - step size for the QSlider

  slider - whether the slider is created or not

- setReferencePoint (ref)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  ref | double |

  Sets the reference Point to ref. It ref == 0, emitting of relativeValueChanged is blocked and relativeValue just returns 0.

- setRelativeValue (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | double |

  Sets the value in units of referencePoint.

- setSpecialValueText (text)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  text | QString |

  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.

- setSuffix (suffix)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  suffix | QString |

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

  See also setSuffix()

- setValue (a0)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  a0 | double |

  Sets the value of the control.

- specialValueText ( )

  returns QString

  Returns the string displayed for a special value.

  See also setSpecialValueText()

- suffix ( )

  returns QString

  Returns the suffix.

  See also setSuffix()

- value ( )

  returns double

  Returns the current value.

- valueChanged (a0)

  returns Nothing
  SIGNAL ("valueChanged (double)")

  Argument | Type | Default
  --- | --- | ---
  a0 | double |

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