KIntNumInput Class Reference
from PyKDE4.kdeui import *
Inherits: KNumInput → QWidget → QObject
Detailed Description
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 |
|
) |
|
|
|
Constructs an input control for integer values
with base 10 and initial value 0.
__init__ |
( |
self, |
|
|
|
int |
value, |
|
|
QWidget |
parent=0, |
|
|
int |
base=10 |
|
) |
|
|
|
Constructor
It constructs a QSpinBox that allows the input of integer numbers
in the range of -INT_MAX to +INT_MAX. To set a descriptive label,
use setLabel(). To enforce the value being in a range and optionally to
attach a slider to it, use setRange().
- Parameters:
-
| value | initial value for the control
|
| base | numeric base used for display
|
| parent | parent QWidget
|
Constructor
the difference to the one above 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).
- Parameters:
-
| below | append KIntNumInput to the KNumInput chain
|
| value | initial value for the control
|
| base | numeric base used for display
|
| parent | parent QWidget
|
- Deprecated:
- use the version without the below parameter instead.
- 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 |
|
) |
|
|
|
Sets the allowed input range and the step size for the slider and the
spin box.
- Parameters:
-
| min | minimum value
|
| max | maximum value
|
| step | step size
|
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 QString() to disable this feature.
Formatting has to be provided (e.g. a space separator between the
prepended value and the suffix's text has to be provided
as the first character in the suffix).
- See also:
- QSpinBox.setSuffix(), #setPrefix()
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)