KIntNumInput Class Reference
from PyKDE4.kdeui import *
Inherits: KNumInput → QWidget → QObject
Detailed Description
An input widget for integer numbers, consisting of a spinbox and a slider.
KIntNumInput combines a QSpinBox and optionally a QSlider
with a label to make an easy to use control for setting some integer
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 or when the user
calls setSliderEnabled.
A special feature of KIntNumInput, designed specifically for
the situation when there are several KIntNumInputs 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 KIntValidator validator class. KIntNumInput enforces the
value to be in the given range, and can display it in any base
between 2 and 36.

"KDE Int Number Input Spinbox"
Signals |
| relativeValueChanged (float a0) |
| valueChanged (int a0) |
Methods |
| __init__ (self, QWidget parent=0) |
| __init__ (self, int value, QWidget parent=0, int base=10) |
| __init__ (self, KNumInput below, int value, QWidget parent, int base=10) |
| __init__ (self, KIntNumInput a0) |
| doLayout (self) |
int | maximum (self) |
int | minimum (self) |
QSize | minimumSizeHint (self) |
QString | prefix (self) |
int | referencePoint (self) |
float | relativeValue (self) |
| relativeValueChanged (self, float a0) |
| resizeEvent (self, QResizeEvent a0) |
| setEditFocus (self, bool mark=1) |
| setLabel (self, QString label, Qt::Alignment a=Qt.AlignLeft|Qt.AlignTop) |
| setMaximum (self, int max) |
| setMinimum (self, int min) |
| setPrefix (self, QString prefix) |
| setRange (self, int min, int max, int singleStep=1) |
| setRange (self, int min, int max, int singleStep, bool slider) |
| setReferencePoint (self, int a0) |
| setRelativeValue (self, float a0) |
| setSingleStep (self, int step) |
| setSliderEnabled (self, bool enabled=1) |
| setSpecialValueText (self, QString text) |
| setSuffix (self, QString suffix) |
| setSuffix (self, KLocalizedString suffix) |
| setValue (self, int a0) |
int | singleStep (self) |
QString | specialValueText (self) |
QSpinBox | spinBox (self) |
QString | suffix (self) |
int | value (self) |
| valueChanged (self, int a0) |
Method Documentation
__init__ |
( |
self, |
|
|
|
QWidget |
parent=0 |
|
) |
|
|
|
__init__ |
( |
self, |
|
|
|
int |
value, |
|
|
QWidget |
parent=0, |
|
|
int |
base=10 |
|
) |
|
|
|
- Returns:
- the maximum value.
- Returns:
- the minimum value.
QSize minimumSizeHint |
( |
|
self ) |
|
This method returns the minimum size necessary to display the
control. The minimum size is enough to show all the labels
in the current font (font change may invalidate the return value).
- Returns:
- the minimum size necessary to show the control
- Returns:
- the prefix displayed in front of the value.
- See also:
- setPrefix()
int referencePoint |
( |
|
self ) |
|
- Returns:
- the current reference point
float relativeValue |
( |
|
self ) |
|
- Returns:
- the curent value in units of the referencePoint.
relativeValueChanged |
( |
self, |
|
|
|
float |
a0 |
|
) |
|
|
|
Emitted whenever valueChanged is. Contains the change
relative to the referencePoint.
- Signal syntax:
QObject.connect(source, SIGNAL("relativeValueChanged(double)"), target_slot)
setEditFocus |
( |
self, |
|
|
|
bool |
mark=1 |
|
) |
|
|
|
sets focus to the edit widget and marks all text in if mark == true
setMaximum |
( |
self, |
|
|
|
int |
max |
|
) |
|
|
|
setMinimum |
( |
self, |
|
|
|
int |
min |
|
) |
|
|
|
Sets the prefix to prefix.
Use QString() to disable this feature.
Formatting has to be provided (see above).
- See also:
- QSpinBox.setPrefix(), #setSuffix()
setRange |
( |
self, |
|
|
|
int |
min, |
|
|
int |
max, |
|
|
int |
singleStep=1 |
|
) |
|
|
|
- Deprecated:
- Use the other setRange function and setSliderEnabled instead
setRange |
( |
self, |
|
|
|
int |
min, |
|
|
int |
max, |
|
|
int |
singleStep, |
|
|
bool |
slider |
|
) |
|
|
|
- Deprecated:
- Use the other setRange function and setSliderEnabled instead
setReferencePoint |
( |
self, |
|
|
|
int |
a0 |
|
) |
|
|
|
Sets the reference point for relativeValue.
setRelativeValue |
( |
self, |
|
|
|
float |
a0 |
|
) |
|
|
|
Sets the value in units of the referencePoint
setSingleStep |
( |
self, |
|
|
|
int |
step |
|
) |
|
|
|
- Returns:
- the step of the spin box
setSliderEnabled |
( |
self, |
|
|
|
bool |
enabled=1 |
|
) |
|
|
|
- Parameters:
-
@default enabled
setSpecialValueText |
( |
self, |
|
|
|
QString |
text |
|
) |
|
|
|
Sets the special value text. If set, the SpinBox 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.
Sets the suffix to suffix.
Use this to add a plural-aware suffix, e.g. by using ki18np("singular", "plural").
- Since:
- 4.3
Sets the suffix to suffix.
Use this to add a plural-aware suffix, e.g. by using ki18np("singular", "plural").
- Since:
- 4.3
setValue |
( |
self, |
|
|
|
int |
a0 |
|
) |
|
|
|
Sets the value of the control.
- Returns:
- the step of the spin box
- Returns:
- the string displayed for a special value.
- See also:
- setSpecialValueText()
- Returns:
- the spin box widget.
- Internal:
-
- Returns:
- the suffix displayed behind the value.
- See also:
- setSuffix()
- Returns:
- the current value.
valueChanged |
( |
self, |
|
|
|
int |
a0 |
|
) |
|
|
|
Emitted every time the value changes (by calling setValue() or
by user interaction).
- Signal syntax:
QObject.connect(source, SIGNAL("valueChanged(int)"), target_slot)