SpinBox2 Class Reference
The SpinBox2 class provides a spin box with two pairs of spin buttons, one on either side. Spin box with a pair of spin buttons on either side. More...
#include <spinbox2.h>
Inherits QFrame.
Inherited by TimeSpinBox.
Public Slots
- virtual void setValue (int val)
- virtual void setPrefix (const QString &text)
- virtual void setSuffix (const QString &text)
- virtual void stepUp ()
- virtual void stepDown ()
- virtual void pageUp ()
- virtual void pageDown ()
- virtual void selectAll ()
Signals
- void valueChanged (int value)
- void valueChanged (const QString &valueText)
Public Member Functions
- SpinBox2 (QWidget *parent=0, const char *name=0)
- SpinBox2 (int minValue, int maxValue, int step=1, int step2=1, QWidget *parent=0, const char *name=0)
- void setReadOnly (bool readOnly)
- bool isReadOnly () const
- void setSelectOnStep (bool sel)
- void setReverseWithLayout (bool reverse)
- bool reverseButtons () const
- QString text () const
- virtual QString prefix () const
- virtual QString suffix () const
- virtual QString cleanText () const
- virtual void setSpecialValueText (const QString &text)
- QString specialValueText () const
- virtual void setWrapping (bool on)
- bool wrapping () const
- virtual void setButtonSymbols (QSpinBox::ButtonSymbols)
- QSpinBox::ButtonSymbols buttonSymbols () const
- virtual void setValidator (const QValidator *v)
- const QValidator * validator () const
- virtual QSize sizeHint () const
- virtual QSize minimumSizeHint () const
- int minValue () const
- int maxValue () const
- void setMinValue (int val)
- void setMaxValue (int val)
- void setRange (int minValue, int maxValue)
- int value () const
- int bound (int val) const
- QRect upRect () const
- QRect downRect () const
- QRect up2Rect () const
- QRect down2Rect () const
- int lineStep () const
- int lineShiftStep () const
- int pageStep () const
- int pageShiftStep () const
- void setLineStep (int step)
- void setSteps (int line, int page)
- void setShiftSteps (int line, int page)
- void addPage ()
- void subtractPage ()
- void addLine ()
- void subtractLine ()
- void addValue (int change)
Protected Slots
Protected Member Functions
- virtual QString mapValueToText (int v)
- virtual int mapTextToValue (bool *ok)
- virtual void resizeEvent (QResizeEvent *)
- virtual void showEvent (QShowEvent *)
- virtual void styleChange (QStyle &)
- virtual void getMetrics () const
Protected Attributes
Friends
Detailed Description
The SpinBox2 class provides a spin box with two pairs of spin buttons, one on either side. Spin box with a pair of spin buttons 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
|
Constructor.
|
|
Constructor.
|
Member Function Documentation
|
Sets whether the spin box can be changed by the user.
|
|
Returns true if the widget is read only.
|
|
Sets whether the spin box value text should be selected when its value is stepped.
|
|
Sets whether the spin button pairs should be reversed for a right-to-left language. The default is for them to be reversed. |
|
Returns whether the spin button pairs will be reversed for a right-to-left language.
|
|
Returns the spin box's text, including any prefix() and suffix().
|
|
Returns the prefix for the spin box's text.
|
|
Returns the suffix for the spin box's text.
|
|
Returns the spin box's text with no prefix(), suffix() or leading or trailing whitespace.
|
|
Sets the special-value text which, if non-null, is displayed instead of a numeric value when the current value is equal to minValue().
|
|
Returns the special-value text which, if non-null, is displayed instead of a numeric value when the current value is equal to minValue().
|
|
Sets whether it is possible to step the value from the highest value to the lowest value and vice versa.
|
|
Returns whether it is possible to step the value from the highest value to the lowest value and vice versa.
|
|
Sets the button symbols to use (arrows or plus/minus).
|
|
Returns the button symbols currently in use (arrows or plus/minus).
|
|
Sets the validator to The validator controls what keyboard input is accepted when the user is editing the value field. |
|
Returns the current validator. The validator controls what keyboard input is accepted when the user is editing the value field. |
|
Returns the minimum value of the spin box.
|
|
Returns the maximum value of the spin box.
|
|
Sets the minimum value of the spin box.
|
|
Sets the maximum value of the spin box.
Reimplemented in TimeSpinBox. |
|
Sets the minimum and maximum values of the spin box.
|
|
Returns the current value of the spin box.
|
|
Returns the specified value clamped to the range of the spin box.
|
|
Returns the geometry of the right-hand "up" button.
|
|
Returns the geometry of the right-hand "down" button.
|
|
Returns the geometry of the left-hand "up" button.
|
|
Returns the geometry of the left-hand "down" button.
|
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
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.
|
|
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.
|
|
Increments the current value by adding the unshifted step increment for the left-hand spin buttons.
|
|
Decrements the current value by subtracting the unshifted step increment for the left-hand spin buttons.
|
|
Increments the current value by adding the unshifted step increment for the right-hand spin buttons.
|
|
Decrements the current value by subtracting the unshifted step increment for the right-hand spin buttons.
|
|
Adjusts the current value by adding
|
|
Sets the current value to
Reimplemented in TimeSpinBox. |
|
Sets the prefix which is prepended to the start of the displayed text.
|
|
Sets the suffix which is prepended to the start of the displayed text.
|
|
Increments the current value by adding the unshifted step increment for the right-hand spin buttons.
Reimplemented in TimeSpinBox. |
|
Decrements the current value by subtracting the unshifted step increment for the right-hand spin buttons.
Reimplemented in TimeSpinBox. |
|
Increments the current value by adding the unshifted step increment for the left-hand spin buttons.
|
|
Decrements the current value by subtracting the unshifted step increment for the left-hand spin buttons.
|
|
Selects all the text in the spin box's editor.
|
|
Signal which is emitted whenever the value of the spin box changes.
|
|
Signal which is emitted whenever the value of the spin box changes.
|
The documentation for this class was generated from the following files:
- spinbox2.h
- spinbox2.cpp