• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kalarm/lib

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

#include <spinbox2.h>

Inheritance diagram for SpinBox2:
Inheritance graph
[legend]

Public Slots

virtual void pageDown ()
 
virtual void pageUp ()
 
void selectAll ()
 
virtual void setEnabled (bool enabled)
 
void setValue (int val)
 

Signals

void valueChanged (int value)
 
void valueChanged (const QString &valueText)
 

Public Member Functions

 SpinBox2 (QWidget *parent=0)
 
 SpinBox2 (int minValue, int maxValue, int pageStep=1, QWidget *parent=0)
 
void addPage ()
 
void addSingle ()
 
void addValue (int change)
 
int bound (int val) const
 
QSpinBox::ButtonSymbols buttonSymbols () const
 
QString cleanText () const
 
QRect down2Rect () const
 
QRect downRect () const
 
bool isReadOnly () const
 
int maximum () const
 
int minimum () const
 
virtual QSize minimumSizeHint () const
 
int pageShiftStep () const
 
int pageStep () const
 
QString prefix () const
 
bool reverseButtons () const
 
void setAlignment (Qt::Alignment a)
 
void setButtonSymbols (QSpinBox::ButtonSymbols)
 
virtual void setMaximum (int val)
 
virtual void setMinimum (int val)
 
void setPrefix (const QString &text)
 
void setRange (int minValue, int maxValue)
 
virtual void setReadOnly (bool readOnly)
 
void setReverseWithLayout (bool reverse)
 
void setSelectOnStep (bool sel)
 
void setShiftSteps (int line, int page)
 
void setSingleStep (int step)
 
void setSpecialValueText (const QString &text)
 
void setSteps (int line, int page)
 
void setSuffix (const QString &text)
 
void setWrapping (bool on)
 
int singleShiftStep () const
 
int singleStep () const
 
virtual QSize sizeHint () const
 
QString specialValueText () const
 
virtual void stepBy (int increment)
 
void subtractPage ()
 
void subtractSingle ()
 
QString suffix () const
 
QString text () const
 
QRect up2Rect () const
 
QRect upRect () const
 
virtual QValidator::State validate (QString &, int &) const
 
int value () const
 
bool wrapping () const
 

Protected Slots

virtual void stepPage (int)
 
virtual void valueChange ()
 

Protected Member Functions

virtual void getMetrics () const
 
virtual void paintEvent (QPaintEvent *)
 
virtual void showEvent (QShowEvent *)
 
virtual void styleChange (QStyle &)
 
virtual QString textFromValue (int v) const
 
virtual int valueFromText (const QString &t) const
 

Protected Attributes

QPoint mButtonPos
 
int wSpinboxHide
 
int wUpdown2
 

Detailed Description

Spin box with a pair of spin buttons on either side.

The SpinBox2 class provides a spin box with two pairs of spin buttons, one on either side.

It is designed as a base class for implementing such facilities as time spin boxes, where the hours and minutes values are separately displayed in the edit field. When the appropriate step increments are configured, the left spin arrows can then be used to change the hours value, while the right spin arrows can be used to change the minutes value.

Rather than using SpinBox2 directly for time entry, use in preference TimeSpinBox or TimeEdit classes which are tailored from SpinBox2 for this purpose.

Separate step increments may optionally be specified for use when the shift key is held down. Typically these would be larger than the normal steps. Then, when the user clicks the spin buttons, he/she can increment or decrement the value faster by holding the shift key down.

The widget may be set as read-only. This has the same effect as disabling it, except that its appearance is unchanged.

Author
David Jarvie djarv.nosp@m.ie@k.nosp@m.de.or.nosp@m.g

Definition at line 57 of file spinbox2.h.

Constructor & Destructor Documentation

SpinBox2::SpinBox2 ( QWidget *  parent = 0)
explicit

Constructor.

Parameters
parentThe parent object of this widget.

Definition at line 63 of file spinbox2.cpp.

SpinBox2::SpinBox2 ( int  minValue,
int  maxValue,
int  pageStep = 1,
QWidget *  parent = 0 
)

Constructor.

Parameters
minValueThe minimum value which the spin box can have.
maxValueThe maximum value which the spin box can have.
pageStepThe (unshifted) step interval for the left-hand spin buttons.
parentThe parent object of this widget.

Definition at line 74 of file spinbox2.cpp.

Member Function Documentation

void SpinBox2::addPage ( )
inline

Increments the current value by adding the unshifted step increment for the left-hand spin buttons.

Definition at line 198 of file spinbox2.h.

void SpinBox2::addSingle ( )
inline

Increments the current value by adding the unshifted step increment for the right-hand spin buttons.

Definition at line 206 of file spinbox2.h.

void SpinBox2::addValue ( int  change)
inline

Adjusts the current value by adding change.

Definition at line 212 of file spinbox2.h.

int SpinBox2::bound ( int  val) const

Returns the specified value clamped to the range of the spin box.

Definition at line 202 of file spinbox2.cpp.

QSpinBox::ButtonSymbols SpinBox2::buttonSymbols ( ) const
inline

Returns the button symbols currently in use (arrows or plus/minus).

Definition at line 123 of file spinbox2.h.

QString SpinBox2::cleanText ( ) const
inline

Returns the spin box's text with no prefix(), suffix() or leading or trailing whitespace.

Definition at line 98 of file spinbox2.h.

QRect SpinBox2::down2Rect ( ) const

Returns the geometry of the left-hand "down" button.

Definition at line 148 of file spinbox2.cpp.

QRect SpinBox2::downRect ( ) const
inline

Returns the geometry of the right-hand "down" button.

Definition at line 149 of file spinbox2.h.

void SpinBox2::getMetrics ( ) const
protectedvirtual

Definition at line 399 of file spinbox2.cpp.

bool SpinBox2::isReadOnly ( ) const
inline

Returns true if the widget is read only.

Definition at line 77 of file spinbox2.h.

int SpinBox2::maximum ( ) const
inline

Returns the maximum value of the spin box.

Definition at line 134 of file spinbox2.h.

int SpinBox2::minimum ( ) const
inline

Returns the minimum value of the spin box.

Definition at line 132 of file spinbox2.h.

QSize SpinBox2::minimumSizeHint ( ) const
virtual

Reimplemented in TimeSpinBox.

Definition at line 250 of file spinbox2.cpp.

virtual void SpinBox2::pageDown ( )
inlinevirtualslot

Decrements the current value by subtracting the unshifted step increment for the left-hand spin buttons.

Definition at line 228 of file spinbox2.h.

int SpinBox2::pageShiftStep ( ) const
inline

Returns the shifted step increment for the left-hand spin buttons, i.e.

the amount by which the spin box value changes when a left-hand spin button is clicked while the shift key is pressed.

Definition at line 174 of file spinbox2.h.

int SpinBox2::pageStep ( ) const
inline

Returns the unshifted step increment for the left-hand spin buttons, i.e.

the amount by which the spin box value changes when a left-hand spin button is clicked without the shift key being pressed.

Definition at line 169 of file spinbox2.h.

virtual void SpinBox2::pageUp ( )
inlinevirtualslot

Increments the current value by adding the unshifted step increment for the left-hand spin buttons.

Definition at line 224 of file spinbox2.h.

void SpinBox2::paintEvent ( QPaintEvent *  e)
protectedvirtual

Definition at line 265 of file spinbox2.cpp.

QString SpinBox2::prefix ( ) const
inline

Returns the prefix for the spin box's text.

Definition at line 90 of file spinbox2.h.

bool SpinBox2::reverseButtons ( ) const
inline

Returns whether the spin button pairs will be reversed for a right-to-left language.

Definition at line 85 of file spinbox2.h.

void SpinBox2::selectAll ( )
inlineslot

Selects all the text in the spin box's editor.

Definition at line 230 of file spinbox2.h.

void SpinBox2::setAlignment ( Qt::Alignment  a)
inline

Set the text alignment of the widget.

Definition at line 119 of file spinbox2.h.

void SpinBox2::setButtonSymbols ( QSpinBox::ButtonSymbols  newSymbols)

Sets the button symbols to use (arrows or plus/minus).

Definition at line 194 of file spinbox2.cpp.

void SpinBox2::setEnabled ( bool  enabled)
virtualslot

Sets whether the widget is enabled.

Definition at line 129 of file spinbox2.cpp.

void SpinBox2::setMaximum ( int  val)
virtual

Sets the maximum value of the spin box.

Reimplemented in TimeSpinBox.

Definition at line 214 of file spinbox2.cpp.

void SpinBox2::setMinimum ( int  val)
virtual

Sets the minimum value of the spin box.

Reimplemented in TimeSpinBox.

Definition at line 207 of file spinbox2.cpp.

void SpinBox2::setPrefix ( const QString &  text)
inline

Sets the prefix which is prepended to the start of the displayed text.

Definition at line 94 of file spinbox2.h.

void SpinBox2::setRange ( int  minValue,
int  maxValue 
)
inline

Sets the minimum and maximum values of the spin box.

Definition at line 140 of file spinbox2.h.

void SpinBox2::setReadOnly ( bool  readOnly)
virtual

Sets whether the spin box can be changed by the user.

Parameters
readOnlyTrue to set the widget read-only, false to set it read-write.

Definition at line 109 of file spinbox2.cpp.

void SpinBox2::setReverseWithLayout ( bool  reverse)

Sets whether the spin button pairs should be reversed for a right-to-left language.

The default is for them to be reversed.

Definition at line 119 of file spinbox2.cpp.

void SpinBox2::setSelectOnStep ( bool  sel)
inline

Sets whether the spin box value text should be selected when its value is stepped.

Definition at line 79 of file spinbox2.h.

void SpinBox2::setShiftSteps ( int  line,
int  page 
)

Sets the shifted step increments for the two pairs of spin buttons, i.e.

the amount by which the spin box value changes when a spin button is clicked while the shift key is pressed.

Parameters
lineThe shift step increment for the right-hand spin buttons.
pageThe shift step increment for the left-hand spin buttons.

Definition at line 178 of file spinbox2.cpp.

void SpinBox2::setSingleStep ( int  step)

Sets the unshifted step increment for the right-hand spin buttons, i.e.

the amount by which the spin box value changes when a right-hand spin button is clicked without the shift key being pressed.

Definition at line 153 of file spinbox2.cpp.

void SpinBox2::setSpecialValueText ( const QString &  text)
inline

Sets the special-value text which, if non-null, is displayed instead of a numeric value when the current value is equal to minimum().

Definition at line 103 of file spinbox2.h.

void SpinBox2::setSteps ( int  line,
int  page 
)

Sets the unshifted step increments for the two pairs of spin buttons, i.e.

the amount by which the spin box value changes when a spin button is clicked without the shift key being pressed.

Parameters
lineThe step increment for the right-hand spin buttons.
pageThe step increment for the left-hand spin buttons.

Definition at line 162 of file spinbox2.cpp.

void SpinBox2::setSuffix ( const QString &  text)
inline

Sets the suffix which is prepended to the start of the displayed text.

Definition at line 96 of file spinbox2.h.

void SpinBox2::setValue ( int  val)
inlineslot

Sets the current value to val.

Definition at line 220 of file spinbox2.h.

void SpinBox2::setWrapping ( bool  on)

Sets whether it is possible to step the value from the highest value to the lowest value and vice versa.

Definition at line 137 of file spinbox2.cpp.

void SpinBox2::showEvent ( QShowEvent *  )
protectedvirtual

Definition at line 235 of file spinbox2.cpp.

int SpinBox2::singleShiftStep ( ) const
inline

Returns the shifted step increment for the right-hand spin buttons, i.e.

the amount by which the spin box value changes when a right-hand spin button is clicked while the shift key is pressed.

Definition at line 164 of file spinbox2.h.

int SpinBox2::singleStep ( ) const
inline

Returns the unshifted step increment for the right-hand spin buttons, i.e.

the amount by which the spin box value changes when a right-hand spin button is clicked without the shift key being pressed.

Definition at line 159 of file spinbox2.h.

QSize SpinBox2::sizeHint ( ) const
virtual

Reimplemented in TimeSpinBox.

Definition at line 242 of file spinbox2.cpp.

QString SpinBox2::specialValueText ( ) const
inline

Returns the special-value text which, if non-null, is displayed instead of a numeric value when the current value is equal to minimum().

Definition at line 107 of file spinbox2.h.

virtual void SpinBox2::stepBy ( int  increment)
inlinevirtual

Increments the current value by adding the unshifted increment for the right-hand spin buttons.

Reimplemented in TimeSpinBox.

Definition at line 216 of file spinbox2.h.

void SpinBox2::stepPage ( int  step)
protectedvirtualslot

Definition at line 449 of file spinbox2.cpp.

void SpinBox2::styleChange ( QStyle &  )
protectedvirtual

Definition at line 258 of file spinbox2.cpp.

void SpinBox2::subtractPage ( )
inline

Decrements the current value by subtracting the unshifted step increment for the left-hand spin buttons.

Definition at line 202 of file spinbox2.h.

void SpinBox2::subtractSingle ( )
inline

Decrements the current value by subtracting the unshifted step increment for the right-hand spin buttons.

Definition at line 210 of file spinbox2.h.

QString SpinBox2::suffix ( ) const
inline

Returns the suffix for the spin box's text.

Definition at line 92 of file spinbox2.h.

QString SpinBox2::text ( ) const
inline

Returns the spin box's text, including any prefix() and suffix().

Definition at line 88 of file spinbox2.h.

virtual QString SpinBox2::textFromValue ( int  v) const
inlineprotectedvirtual

Reimplemented in TimeSpinBox.

Definition at line 241 of file spinbox2.h.

QRect SpinBox2::up2Rect ( ) const

Returns the geometry of the left-hand "up" button.

Definition at line 143 of file spinbox2.cpp.

QRect SpinBox2::upRect ( ) const
inline

Returns the geometry of the right-hand "up" button.

Definition at line 147 of file spinbox2.h.

virtual QValidator::State SpinBox2::validate ( QString &  ,
int &   
) const
inlinevirtual

Determine whether the current input is valid.

Reimplemented in TimeSpinBox.

Definition at line 126 of file spinbox2.h.

int SpinBox2::value ( ) const
inline

Returns the current value of the spin box.

Definition at line 142 of file spinbox2.h.

void SpinBox2::valueChange ( )
protectedvirtualslot

Definition at line 221 of file spinbox2.cpp.

void SpinBox2::valueChanged ( int  value)
signal

Signal which is emitted whenever the value of the spin box changes.

void SpinBox2::valueChanged ( const QString &  valueText)
signal

Signal which is emitted whenever the value of the spin box changes.

virtual int SpinBox2::valueFromText ( const QString &  t) const
inlineprotectedvirtual

Reimplemented in TimeSpinBox.

Definition at line 242 of file spinbox2.h.

bool SpinBox2::wrapping ( ) const
inline

Returns whether it is possible to step the value from the highest value to the lowest value and vice versa.

Definition at line 116 of file spinbox2.h.

Member Data Documentation

QPoint SpinBox2::mButtonPos
mutableprotected

Definition at line 250 of file spinbox2.h.

int SpinBox2::wSpinboxHide
mutableprotected

Definition at line 249 of file spinbox2.h.

int SpinBox2::wUpdown2
mutableprotected

Definition at line 248 of file spinbox2.h.


The documentation for this class was generated from the following files:
  • spinbox2.h
  • spinbox2.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:59:21 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm/lib

Skip menu "kalarm/lib"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal