KNumInput

KDE 4.5 PyKDE API Reference

- KDE's Python API

# KNumInput Class Reference

`from PyKDE4.kdeui import *`

Inherits: QWidget → QObject
Subclasses: KIntNumInput, KDoubleNumInput

## Detailed Description

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

## Methods
| __init__ (self, QWidget parent=0)
| __init__ (self, QWidget parent, KNumInput below)
| __init__ (self, KNumInput a0)
| doLayout (self)
QString | label (self)
| layout (self, bool deep)
| setLabel (self, QString label, Qt::Alignment a=Qt.AlignLeft|Qt.AlignTop)
| setSteps (self, int minor, int major)
bool | showSlider (self)
QSize | sizeHint (self)
QSlider | slider (self)

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Default constructor

Parameters:

  | 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.

__init__ | ( | self, |
|  | QWidget | parent,
|  | KNumInput | below
| ) |  |  |

Parameters:

  | below | A pointer to another KNumInput.
  | parent | parent widget

Deprecated:
  - use the version without the below parameter instead

__init__ | ( | self, |
|  | KNumInput | a0
| ) |  |  |

doLayout | ( |  | self ) |

Abstract method:
  This method is abstract and can be overridden but not called directly.

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

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

QString label | ( |  | self ) |

Returns:
  the text of the label.

layout | ( | self, |
|  | bool | deep
| ) |  |  |

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

setLabel | ( | self, |
|  | QString | label,
|  | Qt::Alignment | a=Qt.AlignLeft|Qt.AlignTop
| ) |  |  |

Sets the text and alignment of the main description label.

Parameters:

  | 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 | ( | self, |
|  | int | minor,
|  | int | major
| ) |  |  |

Sets the spacing of tickmarks for the slider.

Parameters:

  | minor | Minor tickmark separation.
  | major | Major tickmark separation.

bool showSlider | ( |  | self ) |

Returns:
  if the num input has a slider.

QSize sizeHint | ( |  | self ) |

Returns a size which fits the contents of the control.

Returns:
  the preferred size necessary to show the control

QSlider slider | ( |  | self ) |

Returns:
  the slider widget.

Internal: