KDE PIM / Developers / API Docs / kalarm

SpinBox2 Class Reference

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

#include <spinbox2.h>

Inherits QFrame.

Inherited by TimeSpinBox.

List of all members.

Public Slots

Signals

Public Member Functions

Protected Slots

Protected Member Functions

Protected Attributes

Friends


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 <software@astrojar.org.uk>


Constructor & Destructor Documentation

SpinBox2::SpinBox2 QWidget *  parent = 0,
const char *  name = 0
 

Constructor.

Parameters:
parent The parent object of this widget.
name The name of this widget.

SpinBox2::SpinBox2 int  minValue,
int  maxValue,
int  step = 1,
int  step2 = 1,
QWidget *  parent = 0,
const char *  name = 0
 

Constructor.

Parameters:
minValue The minimum value which the spin box can have.
maxValue The maximum value which the spin box can have.
step The (unshifted) step interval for the right-hand spin buttons.
step2 The (unshifted) step interval for the left-hand spin buttons.
parent The parent object of this widget.
name The name of this widget.

Member Function Documentation

void SpinBox2::setReadOnly bool  readOnly  )  [virtual]
 

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

Parameters:
readOnly True to set the widget read-only, false to set it read-write.

bool SpinBox2::isReadOnly  )  const [inline]
 

Returns true if the widget is read only.

void SpinBox2::setSelectOnStep bool  sel  )  [inline]
 

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

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.

bool SpinBox2::reverseButtons  )  const [inline]
 

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

QString SpinBox2::text  )  const [inline]
 

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

virtual QString SpinBox2::prefix  )  const [inline, virtual]
 

Returns the prefix for the spin box's text.

virtual QString SpinBox2::suffix  )  const [inline, virtual]
 

Returns the suffix for the spin box's text.

virtual QString SpinBox2::cleanText  )  const [inline, virtual]
 

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

virtual void SpinBox2::setSpecialValueText const QString &  text  )  [inline, virtual]
 

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

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 minValue().

void SpinBox2::setWrapping bool  on  )  [virtual]
 

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

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.

void SpinBox2::setButtonSymbols QSpinBox::ButtonSymbols   )  [virtual]
 

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

QSpinBox::ButtonSymbols SpinBox2::buttonSymbols  )  const [inline]
 

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

virtual void SpinBox2::setValidator const QValidator *  v  )  [inline, virtual]
 

Sets the validator to v.

The validator controls what keyboard input is accepted when the user is editing the value field.

const QValidator* SpinBox2::validator  )  const [inline]
 

Returns the current validator.

The validator controls what keyboard input is accepted when the user is editing the value field.

int SpinBox2::minValue  )  const [inline]
 

Returns the minimum value of the spin box.

int SpinBox2::maxValue  )  const [inline]
 

Returns the maximum value of the spin box.

void SpinBox2::setMinValue int  val  ) 
 

Sets the minimum value of the spin box.

void SpinBox2::setMaxValue int  val  ) 
 

Sets the maximum value of the spin box.

Reimplemented in TimeSpinBox.

void SpinBox2::setRange int  minValue,
int  maxValue
[inline]
 

Sets the minimum and maximum values of the spin box.

int SpinBox2::value  )  const [inline]
 

Returns the current value of the spin box.

int SpinBox2::bound int  val  )  const
 

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

QRect SpinBox2::upRect  )  const [inline]
 

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

QRect SpinBox2::downRect  )  const [inline]
 

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

QRect SpinBox2::up2Rect  )  const
 

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

QRect SpinBox2::down2Rect  )  const
 

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

int SpinBox2::lineStep  )  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.

int SpinBox2::lineShiftStep  )  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.

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.

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.

void SpinBox2::setLineStep 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.

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:
line The step increment for the right-hand spin buttons.
page The step increment for the left-hand spin buttons.

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:
line The shift step increment for the right-hand spin buttons.
page The shift step increment for the left-hand spin buttons.

void SpinBox2::addPage  )  [inline]
 

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

void SpinBox2::subtractPage  )  [inline]
 

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

void SpinBox2::addLine  )  [inline]
 

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

void SpinBox2::subtractLine  )  [inline]
 

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

void SpinBox2::addValue int  change  )  [inline]
 

Adjusts the current value by adding change.

virtual void SpinBox2::setValue int  val  )  [inline, virtual, slot]
 

Sets the current value to val.

Reimplemented in TimeSpinBox.

virtual void SpinBox2::setPrefix const QString &  text  )  [inline, virtual, slot]
 

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

virtual void SpinBox2::setSuffix const QString &  text  )  [inline, virtual, slot]
 

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

virtual void SpinBox2::stepUp  )  [inline, virtual, slot]
 

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

Reimplemented in TimeSpinBox.

virtual void SpinBox2::stepDown  )  [inline, virtual, slot]
 

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

Reimplemented in TimeSpinBox.

virtual void SpinBox2::pageUp  )  [inline, virtual, slot]
 

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

virtual void SpinBox2::pageDown  )  [inline, virtual, slot]
 

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

virtual void SpinBox2::selectAll  )  [inline, virtual, slot]
 

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

void SpinBox2::setEnabled bool  enabled  )  [virtual, slot]
 

Sets whether the widget is enabled.

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.


The documentation for this class was generated from the following files: