class KIntNumInput

Easy integer parameter entry, with spin and slider. More...

Definition#include <knuminput.h>
InheritsKNumInput
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Slots

Signals

Protected Methods

Protected Slots

Protected Members


Detailed Description

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.

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.

 KIntNumInput (int value, QWidget* parent=0, int base = 10, const char *name=0)

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:
valueinitial value for the control
basenumeric base used for display
parentparent QWidget
nameinternal name for this widget

 KIntNumInput (KNumInput* below, int value, QWidget* parent=0, int base = 10, const char *name=0)

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 it's layout in correspondence with the layout of the other KNumInput's (you can build an arbitary long chain).

Parameters:
belowappend KIntNumInput to the KNumInput chain
valueinitial value for the control
basenumeric base used for display
parentparent QWidget
nameinternal name for this widget

KIntNumInput ()

[virtual]

Destructor

QSize  minimumSizeHint ()

[const virtual]

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

int  value ()

[const]

Returns: the current value

void  setRange (int lower, int upper, int step=1, bool slider=true)

Parameters:
lowerlower bound on range
upperupper bound on range
stepstep size for the QSlider

void  setSpecialValueText (const 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.

void  setLabel (QString label, int a = AlignLeft | AlignTop)

[virtual]

reimplemented for internal reasons.

Reimplemented from KNumInput

void  setValue (int)

[slot]

Sets the value of the control.

void  setSuffix (QString suffix)

[slot]

sets the Suffix

Parameters:
suffixthe suffix that should be used. QString::null to disable

void  setPrefix (QString prefix)

[slot]

sets the Prefix

Parameters:
prefixthe prefix that should be used. QString::null to disable

void  setEditFocus ( bool mark = true )

[slot]

sets focus to the edit widget and marks all text in if mark == true