#include <qwt_counter.h>
Inheritance diagram for QwtCounter:

Public Types | |
| enum | Button { Button1, Button2, Button3, ButtonCnt } |
Signals | |
| void | buttonReleased (double value) |
| void | valueChanged (double value) |
Public Member Functions | |
| QwtCounter (QWidget *parent=0, const char *name=0) | |
| double | step () const |
| void | setStep (double s) |
| double | minVal () const |
| void | setMinValue (double m) |
| double | maxVal () const |
| void | setMaxValue (double m) |
| void | setStepButton1 (int nSteps) |
| int | stepButton1 () const |
| void | setStepButton2 (int nSteps) |
| int | stepButton2 () const |
| void | setStepButton3 (int nSteps) |
| int | stepButton3 () const |
| virtual double | value () const |
| void | setNumButtons (int n) |
| int | numButtons () const |
| void | setIncSteps (QwtCounter::Button btn, int nSteps) |
| int | incSteps (QwtCounter::Button btn) const |
| virtual void | setValue (double) |
| virtual QSizePolicy | sizePolicy () const |
| virtual QSize | sizeHint () const |
Protected Member Functions | |
| virtual void | fontChange (const QFont &f) |
Private Slots | |
| void | btnReleased () |
| void | btnClicked () |
Private Member Functions | |
| void | updateButtons () |
| void | showNum (double) |
| virtual void | valueChange () |
Private Attributes | |
| QwtArrowButton * | d_buttonDown [ButtonCnt] |
| QwtArrowButton * | d_buttonUp [ButtonCnt] |
| QLineEdit * | d_valueEdit |
| int | d_increment [ButtonCnt] |
| int | d_nButtons |
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().
Example:
#include "../include/qwt_counter.h> QwtCounter *cnt; cnt = new QwtCounter(parent, name); cnt->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1.0 cnt->setNumButtons(2); // Two buttons each side cnt->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step cnt->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));
Definition at line 54 of file qwt_counter.h.
|
|
Button index Definition at line 72 of file qwt_counter.h. |
|
||||||||||||
|
The default number of buttons is set to 2. The default increments are:
Definition at line 24 of file qwt_counter.cpp. References btnClicked(), btnReleased(), Button1, Button2, Button3, ButtonCnt, d_buttonDown, d_buttonUp, d_increment, d_valueEdit, setNumButtons(), QwtDblRange::setRange(), and setValue(). |
|
|
Button clicked.
Definition at line 182 of file qwt_counter.cpp. References ButtonCnt, d_buttonDown, d_buttonUp, d_increment, and QwtDblRange::incValue(). Referenced by QwtCounter(). |
|
|
Button released.
Definition at line 195 of file qwt_counter.cpp. References buttonReleased(), and value(). Referenced by QwtCounter(). |
|
|
This signal is emitted when a button has been released
Referenced by btnReleased(). |
|
|
Notify change of font. This function updates the fonts of all widgets contained in QwtCounter.
Definition at line 207 of file qwt_counter.cpp. References d_valueEdit. |
|
|
Definition at line 91 of file qwt_counter.cpp. References ButtonCnt, and d_increment. |
|
|
Definition at line 80 of file qwt_counter.h. References QwtDblRange::maxValue(). |
|
|
Definition at line 78 of file qwt_counter.h. References QwtDblRange::minValue(). |
|
|
Definition at line 166 of file qwt_counter.cpp. References d_nButtons. |
|
||||||||||||
|
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
Definition at line 79 of file qwt_counter.cpp. References ButtonCnt, and d_increment. |
|
|
Definition at line 81 of file qwt_counter.h. References QwtDblRange::minValue(), QwtDblRange::setRange(), and QwtDblRange::step(). |
|
|
Definition at line 79 of file qwt_counter.h. References QwtDblRange::maxValue(), QwtDblRange::setRange(), and QwtDblRange::step(). |
|
|
Specify the number of buttons on each side of the label.
Definition at line 141 of file qwt_counter.cpp. References ButtonCnt, d_buttonDown, d_buttonUp, and d_nButtons. Referenced by QwtCounter(). |
|
|
Change the step raster.
Reimplemented from QwtDblRange. Definition at line 77 of file qwt_counter.h. References QwtDblRange::setStep(). |
|
|
Definition at line 82 of file qwt_counter.h. |
|
|
Definition at line 84 of file qwt_counter.h. |
|
|
Definition at line 86 of file qwt_counter.h. |
|
|
Set a new value.
Reimplemented from QwtDblRange. Definition at line 106 of file qwt_counter.cpp. References QwtDblRange::setValue(), showNum(), updateButtons(), and value(). Referenced by QwtCounter(). |
|
|
Display number string.
Definition at line 172 of file qwt_counter.cpp. References d_valueEdit. Referenced by setValue(), and valueChange(). |
|
|
A size hint.
Definition at line 214 of file qwt_counter.cpp. References d_valueEdit, QwtDblRange::maxValue(), QwtDblRange::minValue(), and step(). |
|
|
Definition at line 244 of file qwt_counter.cpp. |
|
|
Reimplemented from QwtDblRange. Definition at line 76 of file qwt_counter.h. References QwtDblRange::step(). Referenced by sizeHint(). |
|
|
Definition at line 83 of file qwt_counter.h. |
|
|
Definition at line 85 of file qwt_counter.h. |
|
|
Definition at line 87 of file qwt_counter.h. |
|
|
Update buttons according to the current value.
Definition at line 128 of file qwt_counter.cpp. References ButtonCnt, d_buttonDown, d_buttonUp, QwtDblRange::maxValue(), QwtDblRange::minValue(), and value(). Referenced by setValue(), and valueChange(). |
|
|
Returns the current value.
Reimplemented from QwtDblRange. Definition at line 88 of file qwt_counter.h. References QwtDblRange::value(). Referenced by btnReleased(), setValue(), updateButtons(), and valueChange(). |
|
|
Notify a change of value.
Reimplemented from QwtDblRange. Definition at line 117 of file qwt_counter.cpp. References showNum(), updateButtons(), value(), and valueChanged(). |
|
|
This signal is emitted when the counter's value has changed
Referenced by valueChange(). |
|
|
Definition at line 125 of file qwt_counter.h. Referenced by btnClicked(), QwtCounter(), setNumButtons(), and updateButtons(). |
|
|
Definition at line 126 of file qwt_counter.h. Referenced by btnClicked(), QwtCounter(), setNumButtons(), and updateButtons(). |
|
|
Definition at line 129 of file qwt_counter.h. Referenced by btnClicked(), incSteps(), QwtCounter(), and setIncSteps(). |
|
|
Definition at line 130 of file qwt_counter.h. Referenced by numButtons(), and setNumButtons(). |
|
|
Definition at line 127 of file qwt_counter.h. Referenced by fontChange(), QwtCounter(), showNum(), and sizeHint(). |
1.3.2