• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

Public Slots | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
KIntNumInput Class Reference

#include <knuminput.h>

Inheritance diagram for KIntNumInput:
KNumInput

Public Slots

void setValue (int)
void setRelativeValue (double)
void setReferencePoint (int)
void setSuffix (const TQString &suffix)
void setPrefix (const TQString &prefix)
void setEditFocus (bool mark=true)

Signals

void valueChanged (int)
void relativeValueChanged (double)

Public Member Functions

 KIntNumInput (TQWidget *parent=0, const char *name=0)
 KIntNumInput (int value, TQWidget *parent=0, int base=10, const char *name=0)
 KIntNumInput (KNumInput *below, int value, TQWidget *parent=0, int base=10, const char *name=0)
virtual ~KIntNumInput ()
int value () const
double relativeValue () const
int referencePoint () const
TQString suffix () const
TQString prefix () const
TQString specialValueText () const
void setRange (int min, int max, int step=1, bool slider=true)
void setMinValue (int min)
int minValue () const
void setMaxValue (int max)
int maxValue () const
void setSpecialValueText (const TQString &text)
virtual void setLabel (const TQString &label, int a=AlignLeft|AlignTop)
virtual TQSize minimumSizeHint () const
- Public Member Functions inherited from KNumInput
 KNumInput (TQWidget *parent=0, const char *name=0)
 KNumInput (KNumInput *below, TQWidget *parent=0, const char *name=0)
TQString label () const
bool showSlider () const
void setSteps (int minor, int major)
TQSizePolicy sizePolicy () const
virtual TQSize sizeHint () const

Protected Member Functions

virtual void doLayout ()
void resizeEvent (TQResizeEvent *)
virtual void virtual_hook (int id, void *data)
- Protected Member Functions inherited from KNumInput
void layout (bool deep)

Protected Attributes

KIntSpinBox * m_spin
TQSize m_sizeSpin
- Protected Attributes inherited from KNumInput
KNumInput * m_prev
KNumInput * m_next
int m_colw1
int m_colw2
TQLabel * m_label
TQSlider * m_slider
TQSize m_sizeSlider
TQSize m_sizeLabel
int m_alignment

Detailed Description

An input widget for integer numbers, consisting of a spinbox and a slider.

KIntNumInput combines a TQSpinBox 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 with the slider parameter set to "true".

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 TQSpinBox (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.png
KDE Int Number Input Spinbox
Version
$Id$

Definition at line 188 of file knuminput.h.

Constructor & Destructor Documentation

KIntNumInput::KIntNumInput ( TQWidget *  parent = 0,
const char *  name = 0 
)

Constructs an input control for integer values with base 10 and initial value 0.

Definition at line 279 of file knuminput.cpp.

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

Constructor It constructs a TQSpinBox 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

Definition at line 285 of file knuminput.cpp.

KIntNumInput::KIntNumInput ( KNumInput *  below,
int  value,
TQWidget *  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 arbitrary 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

Definition at line 272 of file knuminput.cpp.

KIntNumInput::~KIntNumInput ( )
virtual

Destructor.

Definition at line 490 of file knuminput.cpp.

Member Function Documentation

void KIntNumInput::doLayout ( )
protectedvirtual

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

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

Implements KNumInput.

Definition at line 446 of file knuminput.cpp.

int KIntNumInput::maxValue ( ) const
Returns
the maximum value.

Definition at line 387 of file knuminput.cpp.

TQSize KIntNumInput::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

Definition at line 421 of file knuminput.cpp.

int KIntNumInput::minValue ( ) const
Returns
the minimum value.

Definition at line 377 of file knuminput.cpp.

TQString KIntNumInput::prefix ( ) const
Returns
the prefix displayed in front of the value.
See Also
setPrefix()

Definition at line 411 of file knuminput.cpp.

int KIntNumInput::referencePoint ( ) const
Returns
the current reference point
Since
3.1

Definition at line 316 of file knuminput.cpp.

double KIntNumInput::relativeValue ( ) const
Returns
the curent value in units of the referencePoint.
Since
3.1

Definition at line 508 of file knuminput.cpp.

void KIntNumInput::relativeValueChanged ( double  )
signal

Emitted whenever valueChanged is.

Contains the change relative to the referencePoint.

Since
3.1
void KIntNumInput::setEditFocus ( bool  mark = true)
slot

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

Definition at line 416 of file knuminput.cpp.

void KIntNumInput::setLabel ( const TQString &  label,
int  a = AlignLeft | AlignTop 
)
virtual

Sets the text and alignment of the main description label.

Parameters
labelThe text of the label. Use TQString::null to remove an existing one.
aone of AlignLeft, AlignHCenter, YAlignRight and AlignTop, AlignVCenter, AlignBottom. default is AlignLeft | AlignTop.

The vertical alignment flags have special meaning with this widget:

@li @p AlignTop     The label is placed above the edit/slider
@li @p AlignVCenter The label is placed left beside the edit
@li @p AlignBottom  The label is placed below the edit/slider

Reimplemented from KNumInput.

Definition at line 529 of file knuminput.cpp.

void KIntNumInput::setMaxValue ( int  max)

Sets the maximum value.

Definition at line 382 of file knuminput.cpp.

void KIntNumInput::setMinValue ( int  min)

Sets the minimum value.

Definition at line 372 of file knuminput.cpp.

void KIntNumInput::setPrefix ( const TQString &  prefix)
slot

Sets the prefix to prefix.

Use TQString::null to disable this feature. Formatting has to be provided (see above).

See Also
TQSpinBox::setPrefix(), setSuffix()

Definition at line 404 of file knuminput.cpp.

void KIntNumInput::setRange ( int  min,
int  max,
int  step = 1,
bool  slider = true 
)
Parameters
minminimum value
maxmaximum value
stepstep size for the QSlider
sliderwhether the slider is created or not

Definition at line 333 of file knuminput.cpp.

void KIntNumInput::setReferencePoint ( int  ref)
slot

Sets the reference point for relativeValue.

Since
3.1

Definition at line 310 of file knuminput.cpp.

void KIntNumInput::setRelativeValue ( double  r)
slot

Sets the value in units of the referencePoint.

Since
3.1

Definition at line 501 of file knuminput.cpp.

void KIntNumInput::setSpecialValueText ( const TQString &  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.

Definition at line 518 of file knuminput.cpp.

void KIntNumInput::setSuffix ( const TQString &  suffix)
slot

Sets the suffix to suffix.

Use TQString::null 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
TQSpinBox::setSuffix(), setPrefix()

Definition at line 392 of file knuminput.cpp.

void KIntNumInput::setValue ( int  val)
slot

Sets the value of the control.

Definition at line 495 of file knuminput.cpp.

TQString KIntNumInput::specialValueText ( ) const
Returns
the string displayed for a special value.
See Also
setSpecialValueText()

Definition at line 524 of file knuminput.cpp.

TQString KIntNumInput::suffix ( ) const
Returns
the suffix displayed behind the value.
See Also
setSuffix()

Definition at line 399 of file knuminput.cpp.

int KIntNumInput::value ( ) const
Returns
the current value.

Definition at line 513 of file knuminput.cpp.

void KIntNumInput::valueChanged ( int  )
signal

Emitted every time the value changes (by calling setValue() or by user interaction).


The documentation for this class was generated from the following files:
  • knuminput.h
  • knuminput.cpp

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.