|
Qwt User's Guide
5.2.3
|
#include <qwt_counter.h>

Public Types | |
| enum | Button { Button1, Button2, Button3, ButtonCnt } |
Signals | |
| void | buttonReleased (double value) |
| void | valueChanged (double value) |
Public Member Functions | |
| QwtCounter (QWidget *parent=NULL) | |
| virtual | ~QwtCounter () |
| bool | editable () const |
| int | incSteps (QwtCounter::Button btn) const |
| double | maxVal () const |
| double | minVal () const |
| int | numButtons () const |
| virtual void | polish () |
| void | setEditable (bool) |
| void | setIncSteps (QwtCounter::Button btn, int nSteps) |
| void | setMaxValue (double m) |
| void | setMinValue (double m) |
| void | setNumButtons (int n) |
| void | setStep (double s) |
| void | setStepButton1 (int nSteps) |
| void | setStepButton2 (int nSteps) |
| void | setStepButton3 (int nSteps) |
| virtual void | setValue (double) |
| virtual QSize | sizeHint () const |
| double | step () const |
| int | stepButton1 () const |
| int | stepButton2 () const |
| int | stepButton3 () const |
| virtual double | value () const |
Public Member Functions inherited from QwtDoubleRange | |
| QwtDoubleRange () | |
| virtual | ~QwtDoubleRange () |
| virtual void | fitValue (double) |
| virtual void | incPages (int) |
| virtual void | incValue (int) |
| bool | isValid () const |
| double | maxValue () const |
| double | minValue () const |
| int | pageSize () const |
| bool | periodic () const |
| void | setPeriodic (bool tf) |
| void | setRange (double vmin, double vmax, double vstep=0.0, int pagesize=1) |
| void | setValid (bool) |
Protected Member Functions | |
| virtual bool | event (QEvent *) |
| virtual void | keyPressEvent (QKeyEvent *) |
| virtual void | rangeChange () |
| virtual void | wheelEvent (QWheelEvent *) |
Protected Member Functions inherited from QwtDoubleRange | |
| double | exactPrevValue () const |
| double | exactValue () const |
| double | prevValue () const |
| virtual void | stepChange () |
The Counter Widget.
A Counter consists of a label displaying a number and one ore more (up to three) push buttons on each side of the label which can be used to increment or decrement the counter's value.
A Counter has a range from a minimum value to a maximum value and a step size. The range can be specified using QwtDblRange::setRange(). The counter's value is an integer multiple of the step size. The number of steps by which a button increments or decrements the value can be specified using QwtCounter::setIncSteps(). The number of buttons can be changed with QwtCounter::setNumButtons().
Holding the space bar down with focus on a button is the fastest method to step through the counter values. When the counter underflows/overflows, the focus is set to the smallest up/down button and counting is disabled. Counting is re-enabled on a button release event (mouse or space bar).
Example:
| enum QwtCounter::Button |
Button index
|
explicit |
The default number of buttons is set to 2. The default increments are:
| parent |
|
signal |
This signal is emitted when a button has been released
| value | The new value |
|
protectedvirtual |
Handle PolishRequest events
| int QwtCounter::incSteps | ( | QwtCounter::Button | btn | ) | const |
| btn | One of QwtCounter::Button1, QwtCounter::Button2, QwtCounter::Button3 |
|
protectedvirtual |
Handle key events
| int QwtCounter::numButtons | ( | ) | const |
|
virtual |
Sets the minimum width for the buttons
|
protectedvirtual |
Notify change of range.
This function updates the enabled property of all buttons contained in QwtCounter.
Reimplemented from QwtDoubleRange.
| void QwtCounter::setEditable | ( | bool | editable | ) |
Allow/disallow the user to manually edit the value.
| editable | true enables editing |
| void QwtCounter::setIncSteps | ( | QwtCounter::Button | btn, |
| int | nSteps | ||
| ) |
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
| btn | One of QwtCounter::Button1, QwtCounter::Button2, QwtCounter::Button3 |
| nSteps | Number of steps |
| void QwtCounter::setMaxValue | ( | double | value | ) |
| void QwtCounter::setMinValue | ( | double | value | ) |
| void QwtCounter::setNumButtons | ( | int | n | ) |
Specify the number of buttons on each side of the label.
| n | Number of buttons |
| void QwtCounter::setStep | ( | double | stepSize | ) |
Set the step size
| stepSize | Step size |
Reimplemented from QwtDoubleRange.
| void QwtCounter::setStepButton1 | ( | int | nSteps | ) |
Set the number of increment steps for button 1
| nSteps | Number of steps |
| void QwtCounter::setStepButton2 | ( | int | nSteps | ) |
Set the number of increment steps for button 2
| nSteps | Number of steps |
| void QwtCounter::setStepButton3 | ( | int | nSteps | ) |
Set the number of increment steps for button 3
| nSteps | Number of steps |
|
virtual |
Set a new value.
| v | new value Calls QwtDoubleRange::setValue and does all visual updates. |
Reimplemented from QwtDoubleRange.
|
virtual |
Reimplemented from QwtDoubleRange.
|
signal |
This signal is emitted when the counter's value has changed
| value | The new value |
|
protectedvirtual |
Handle wheel events
| e | Wheel event |
1.8.1