# class KNumInput

### abstract

Module | kdeui
Namespace |
Class | KNumInput
Inherits | QWidget

You need to inherit from this class if you want to implement K*NumInput for a different variable type

### methods

- KNumInput (parent)

  returns ctor
  KDE 4.1.0 and later only

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

  Default constructor

  parent - If parent is 0, the new widget becomes a top-level window. If parent is another widget, this widget becomes a child window inside parent. The new widget is deleted when its parent is deleted.

- KNumInput (parent, below)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  parent | QWidget |
  below | KNumInput |

  below - A pointer to another KNumInput.

  parent - parent widget Deprecated - use the version without the below parameter instead

- KNumInput (a0)

  returns ctor
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  a0 | KNumInput |

- KNumInput (a0)

  returns ctor
  before KDE 4.1.0 only

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

- doLayout ( )

  returns Nothing
  pure virtual

  You need to overwrite this method and implement your layout calculations there.

  See KIntNumInput.doLayout and KDoubleNumInput.doLayout implementation for details.

- label ( )

  returns QString

  Returns the text of the label.

- layout (deep)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  deep | bool |

  Call this function whenever you change something in the geometry of your KNumInput child.

- setLabel (label, a)

  returns Nothing

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

  Sets the text and alignment of the main description label.

  label - The text of the label. Use QString() to remove an existing one.

  a - The alignment of the label (Qt.Alignment). Default is Qt:AlignLeft | Qt:AlignTop.

  The vertical alignment flags have special meaning with this widget:

- Qt:AlignTop The label is placed above the edit/slider
- Qt:AlignVCenter The label is placed left beside the edit
- Qt:AlignBottom The label is placed below the edit/slider

- setSteps (minor, major)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  minor | int |
  major | int |

  Sets the spacing of tickmarks for the slider.

  minor - Minor tickmark separation.

  major - Major tickmark separation.

- showSlider ( )

  returns bool

  Returns if the num input has a slider.

- sizeHint ( )

  returns QSize

  Returns a size which fits the contents of the control.

  Returns the preferred size necessary to show the control

- slider ( )

  returns QSlider

  Returns the slider widget. Internal