• 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 | Friends | List of all members
KDoubleNumInput Class Reference

#include <knuminput.h>

Inheritance diagram for KDoubleNumInput:
KNumInput

Public Slots

void setValue (double)
 
void setRelativeValue (double)
 
void setReferencePoint (double ref)
 
void setSuffix (const TQString &suffix)
 
void setPrefix (const TQString &prefix)
 

Signals

void valueChanged (double)
 
void relativeValueChanged (double)
 

Public Member Functions

 KDoubleNumInput (TQWidget *parent=0, const char *name=0)
 
 KDoubleNumInput (double value, TQWidget *parent=0, const char *name=0) TDE_DEPRECATED
 
 KDoubleNumInput (double lower, double upper, double value, double step=0.01, int precision=2, TQWidget *parent=0, const char *name=0)
 
virtual ~KDoubleNumInput ()
 
 KDoubleNumInput (KNumInput *below, double value, TQWidget *parent=0, const char *name=0) TDE_DEPRECATED
 
 KDoubleNumInput (KNumInput *below, double lower, double upper, double value, double step=0.02, int precision=2, TQWidget *parent=0, const char *name=0)
 
double value () const
 
TQString suffix () const
 
TQString prefix () const
 
int precision () const
 
TQString specialValueText () const
 
void setRange (double min, double max, double step=1, bool slider=true)
 
void setMinValue (double min)
 
double minValue () const
 
void setMaxValue (double max)
 
double maxValue () const
 
void setPrecision (int precision)
 
double referencePoint () const
 
double relativeValue () const
 
void setSpecialValueText (const TQString &text)
 
virtual void setLabel (const TQString &label, int a=AlignLeft|AlignTop)
 
virtual TQSize minimumSizeHint () const
 
virtual bool eventFilter (TQObject *, TQEvent *)
 
- Public Member Functions inherited from KNumInput
 KNumInput (TQWidget *parent=0, const char *name=0)
 
 KNumInput (KNumInput *below, TQWidget *parent=0, const char *name=0)
 
virtual void setLabel (const TQString &label, int a=AlignLeft|AlignTop)
 
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 resetEditBox ()
 
virtual void virtual_hook (int id, void *data)
 
- Protected Member Functions inherited from KNumInput
void layout (bool deep)
 
virtual void doLayout ()=0
 
virtual void virtual_hook (int id, void *data)
 

Protected Attributes

KDoubleLine * edit
 
bool m_range
 
double m_lower
 
double m_upper
 
double m_step
 
TQSize m_sizeEdit
 
- 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
 

Friends

class KDoubleLine
 

Detailed Description

An input control for real numbers, consisting of a spinbox and a slider.

KDoubleNumInput combines a TQSpinBox and optionally a QSlider with a label to make an easy to use control for setting some float 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 KDoubleNumInput, designed specifically for the situation when there are several instances 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 the KDoubleValidator validator class. KDoubleNumInput enforces the value to be in the given range, but see the class documentation of KDoubleSpinBox for the tricky interrelationship of precision and values. All of what is said there applies here, too.

See also
KIntNumInput, KDoubleSpinBox

Definition at line 434 of file knuminput.h.

Constructor & Destructor Documentation

◆ KDoubleNumInput() [1/5]

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

Constructs an input control for double values with initial value 0.00.

Definition at line 549 of file knuminput.cpp.

◆ KDoubleNumInput() [2/5]

KDoubleNumInput::KDoubleNumInput ( double  value,
TQWidget *  parent = 0,
const char *  name = 0 
)
Deprecated:
(value is rounded to a multiple of 1/100) Constructor
Parameters
valueinitial value for the control
parentparent TQWidget
nameinternal name for this widget

Definition at line 572 of file knuminput.cpp.

◆ KDoubleNumInput() [3/5]

KDoubleNumInput::KDoubleNumInput ( double  lower,
double  upper,
double  value,
double  step = 0.01,
int  precision = 2,
TQWidget *  parent = 0,
const char *  name = 0 
)

Constructor.

Parameters
lowerlower boundary value
upperupper boundary value
valueinitial value for the control
stepstep size to use for up/down arrow clicks
precisionnumber of digits after the decimal point
parentparent TQWidget
nameinternal name for this widget
Since
3.1

Definition at line 555 of file knuminput.cpp.

◆ ~KDoubleNumInput()

KDoubleNumInput::~KDoubleNumInput ( )
virtual

destructor

Definition at line 585 of file knuminput.cpp.

◆ KDoubleNumInput() [4/5]

KDoubleNumInput::KDoubleNumInput ( KNumInput *  below,
double  value,
TQWidget *  parent = 0,
const char *  name = 0 
)
Deprecated:
(rounds value to a multiple of 1/100) Constructor

puts it visually below other KNumInput

Parameters
below
valueinitial value for the control
parentparent TQWidget
nameinternal name for this widget

Definition at line 578 of file knuminput.cpp.

◆ KDoubleNumInput() [5/5]

KDoubleNumInput::KDoubleNumInput ( KNumInput *  below,
double  lower,
double  upper,
double  value,
double  step = 0.02,
int  precision = 2,
TQWidget *  parent = 0,
const char *  name = 0 
)

Constructor.

the difference here 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 KDoubleNumInput to the KDoubleNumInput chain
lowerlower boundary value
upperupper boundary value
valueinitial value for the control
stepstep size to use for up/down arrow clicks
precisionnumber of digits after the decimal point
parentparent TQWidget
nameinternal name for this widget
Since
3.1

Definition at line 563 of file knuminput.cpp.

Member Function Documentation

◆ doLayout()

void KDoubleNumInput::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 725 of file knuminput.cpp.

◆ eventFilter()

bool KDoubleNumInput::eventFilter ( TQObject *  o,
TQEvent *  e 
)
virtual

Definition at line 592 of file knuminput.cpp.

◆ maxValue()

double KDoubleNumInput::maxValue ( ) const
Returns
the maximum value.

Definition at line 813 of file knuminput.cpp.

◆ minimumSizeHint()

TQSize KDoubleNumInput::minimumSizeHint ( ) const
virtual

Definition at line 661 of file knuminput.cpp.

◆ minValue()

double KDoubleNumInput::minValue ( ) const
Returns
the minimum value.

Definition at line 803 of file knuminput.cpp.

◆ precision()

int KDoubleNumInput::precision ( ) const
Returns
the precision.
See also
setPrecision()

Definition at line 875 of file knuminput.cpp.

◆ prefix()

TQString KDoubleNumInput::prefix ( ) const
Returns
the prefix.
See also
setPrefix()

Definition at line 839 of file knuminput.cpp.

◆ referencePoint()

double KDoubleNumInput::referencePoint ( ) const
Returns
the reference point for relativeValue calculation
Since
3.1

Definition at line 829 of file knuminput.cpp.

◆ relativeValue()

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

Definition at line 823 of file knuminput.cpp.

◆ relativeValueChanged

void KDoubleNumInput::relativeValueChanged ( double  )
signal

This is an overloaded member function, provided for convenience.

It essentially behaves like the above function.

Contains the value in units of referencePoint.

Since
3.1

◆ resetEditBox()

void KDoubleNumInput::resetEditBox ( )
protectedvirtual

Definition at line 596 of file knuminput.cpp.

◆ resizeEvent()

void KDoubleNumInput::resizeEvent ( TQResizeEvent *  e)
protected

Definition at line 686 of file knuminput.cpp.

◆ setLabel()

void KDoubleNumInput::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 888 of file knuminput.cpp.

◆ setMaxValue()

void KDoubleNumInput::setMaxValue ( double  max)

Sets the maximum value.

Definition at line 808 of file knuminput.cpp.

◆ setMinValue()

void KDoubleNumInput::setMinValue ( double  min)

Sets the minimum value.

Definition at line 798 of file knuminput.cpp.

◆ setPrecision()

void KDoubleNumInput::setPrecision ( int  precision)

Specifies the number of digits to use.

Definition at line 858 of file knuminput.cpp.

◆ setPrefix

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

Sets the prefix to be displayed to prefix.

Use TQString::null to disable this feature. Note that the prefix is attached to the value without any spacing.

See also
setPrefix()

Definition at line 851 of file knuminput.cpp.

◆ setRange()

void KDoubleNumInput::setRange ( double  min,
double  max,
double  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 751 of file knuminput.cpp.

◆ setReferencePoint

void KDoubleNumInput::setReferencePoint ( double  ref)
slot

Sets the reference Point to ref.

It ref == 0, emitting of relativeValueChanged is blocked and relativeValue just returns 0.

Since
3.1

Definition at line 744 of file knuminput.cpp.

◆ setRelativeValue

void KDoubleNumInput::setRelativeValue ( double  r)
slot

Sets the value in units of referencePoint.

Since
3.1

Definition at line 736 of file knuminput.cpp.

◆ setSpecialValueText()

void KDoubleNumInput::setSpecialValueText ( const TQString &  text)

Sets the special value text.

If set, the spin box 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 880 of file knuminput.cpp.

◆ setSuffix

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

Sets the suffix to be displayed to suffix.

Use TQString::null to disable this feature. Note that the suffix is attached to the value without any spacing. So if you prefer to display a space separator, set suffix to something like " cm".

See also
setSuffix()

Definition at line 844 of file knuminput.cpp.

◆ setValue

void KDoubleNumInput::setValue ( double  val)
slot

Sets the value of the control.

Definition at line 731 of file knuminput.cpp.

◆ specialValueText()

TQString KDoubleNumInput::specialValueText ( ) const
inline
Returns
the string displayed for a special value.
See also
setSpecialValueText()

Definition at line 550 of file knuminput.h.

◆ suffix()

TQString KDoubleNumInput::suffix ( ) const
Returns
the suffix.
See also
setSuffix()

Definition at line 834 of file knuminput.cpp.

◆ value()

double KDoubleNumInput::value ( ) const
Returns
the current value.

Definition at line 818 of file knuminput.cpp.

◆ valueChanged

void KDoubleNumInput::valueChanged ( double  )
signal

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

◆ virtual_hook()

void KDoubleNumInput::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

Reimplemented from KNumInput.

Definition at line 1199 of file knuminput.cpp.

Friends And Related Function Documentation

◆ KDoubleLine

friend class KDoubleLine
friend

Definition at line 676 of file knuminput.h.

Member Data Documentation

◆ edit

KDoubleLine* KDoubleNumInput::edit
protected

Definition at line 668 of file knuminput.h.

◆ m_lower

double KDoubleNumInput::m_lower
protected

Definition at line 671 of file knuminput.h.

◆ m_range

bool KDoubleNumInput::m_range
protected

Definition at line 670 of file knuminput.h.

◆ m_sizeEdit

TQSize KDoubleNumInput::m_sizeEdit
protected

Definition at line 674 of file knuminput.h.

◆ m_step

double KDoubleNumInput::m_step
protected

Definition at line 671 of file knuminput.h.

◆ m_upper

double KDoubleNumInput::m_upper
protected

Definition at line 671 of file knuminput.h.


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.9.4
This website is maintained by Timothy Pearson.