1
.TH "QwtCounter" 3 "Fri Apr 15 2011" "Version 6.0.0" "Qwt User's Guide" \" -*- nroff -*-
13
\fC#include <qwt_counter.h>\fP
15
Inherits \fBQwtDoubleRange\fP.
20
.RI "enum \fBButton\fP { \fBButton1\fP, \fBButton2\fP, \fBButton3\fP, \fBButtonCnt\fP }"
27
.RI "void \fBbuttonReleased\fP (double value)"
30
.RI "void \fBvalueChanged\fP (double value)"
33
.SS "Public Member Functions"
37
.RI "\fBQwtCounter\fP (QWidget *parent=NULL)"
40
.RI "virtual \fB~QwtCounter\fP ()"
43
.RI "bool \fBeditable\fP () const "
46
.RI "void \fBsetEditable\fP (bool)"
49
.RI "void \fBsetNumButtons\fP (int n)"
52
.RI "int \fBnumButtons\fP () const "
55
.RI "void \fBsetIncSteps\fP (\fBQwtCounter::Button\fP btn, int nSteps)"
58
.RI "int \fBincSteps\fP (\fBQwtCounter::Button\fP btn) const "
61
.RI "virtual void \fBsetValue\fP (double)"
64
.RI "virtual QSize \fBsizeHint\fP () const "
67
.RI "double \fBstep\fP () const "
70
.RI "void \fBsetStep\fP (double s)"
73
.RI "double \fBminValue\fP () const "
76
.RI "void \fBsetMinValue\fP (double m)"
79
.RI "double \fBmaxValue\fP () const "
82
.RI "void \fBsetMaxValue\fP (double m)"
85
.RI "void \fBsetStepButton1\fP (int nSteps)"
88
.RI "int \fBstepButton1\fP () const "
91
.RI "void \fBsetStepButton2\fP (int nSteps)"
94
.RI "int \fBstepButton2\fP () const "
97
.RI "void \fBsetStepButton3\fP (int nSteps)"
100
.RI "int \fBstepButton3\fP () const "
103
.RI "virtual double \fBvalue\fP () const "
106
.SS "Protected Member Functions"
110
.RI "virtual bool \fBevent\fP (QEvent *)"
113
.RI "virtual void \fBwheelEvent\fP (QWheelEvent *)"
116
.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
119
.RI "virtual void \fBrangeChange\fP ()"
122
.SH "Detailed Description"
126
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.
128
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 \fBQwtCounter::setIncSteps()\fP. The number of buttons can be changed with \fBQwtCounter::setNumButtons()\fP.
130
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).
135
#include '../include/qwt_counter.h>
139
cnt = new QwtCounter(parent, name);
141
cnt->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1.0
142
cnt->setNumButtons(2); // Two buttons each side
143
cnt->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step
144
cnt->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps
146
connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));
151
.SH "Member Enumeration Documentation"
153
.SS "enum \fBQwtCounter::Button\fP"
161
Button intended for minor steps.
164
Button intended for medium steps.
167
Button intended for large steps.
169
\fB\fIButtonCnt \fP\fP
171
.SH "Constructor & Destructor Documentation"
173
.SS "QwtCounter::QwtCounter (QWidget *parent = \fCNULL\fP)\fC [explicit]\fP"The default number of buttons is set to 2. The default increments are:
189
.SS "QwtCounter::~QwtCounter ()\fC [virtual]\fP"
192
.SH "Member Function Documentation"
194
.SS "void QwtCounter::buttonReleased (doublevalue)\fC [signal]\fP"This signal is emitted when a button has been released
198
\fIvalue\fP The new value
202
.SS "bool QwtCounter::editable () const"
204
returns whether the line edit is edatble. (default is yes)
205
.SS "bool QwtCounter::event (QEvent *event)\fC [protected, virtual]\fP"Handle PolishRequest events
213
.SS "int QwtCounter::incSteps (\fBQwtCounter::Button\fPbutton) const"\fBReturns:\fP
215
the number of steps by which a specified button increments the value or 0 if the button is invalid.
220
\fIbutton\fP Button index
229
.SS "void QwtCounter::keyPressEvent (QKeyEvent *event)\fC [protected, virtual]\fP"Handle key events
234
Step to \fBminValue()\fP
238
Step to \fBmaxValue()\fP
242
Increment by incSteps(QwtCounter::Button1)
246
Decrement by incSteps(QwtCounter::Button1)
250
Increment by incSteps(QwtCounter::Button2)
254
Decrement by incSteps(QwtCounter::Button2)
256
Shift + Qt::Key_PageUp
258
Increment by incSteps(QwtCounter::Button3)
260
Shift + Qt::Key_PageDown
262
Decrement by incSteps(QwtCounter::Button3)
267
\fIevent\fP Key event
271
.SS "double QwtCounter::maxValue () const"
273
returns the maximum value of the range
275
Reimplemented from \fBQwtDoubleRange\fP.
276
.SS "double QwtCounter::minValue () const"
278
returns the minimum value of the range
280
Reimplemented from \fBQwtDoubleRange\fP.
281
.SS "int QwtCounter::numButtons () const"\fBReturns:\fP
283
The number of buttons on each side of the widget.
287
.SS "void QwtCounter::rangeChange ()\fC [protected, virtual]\fP"
289
Notify change of range. This function updates the enabled property of all buttons contained in \fBQwtCounter\fP.
291
Reimplemented from \fBQwtDoubleRange\fP.
292
.SS "void QwtCounter::setEditable (booleditable)"
294
Allow/disallow the user to manually edit the value. \fBParameters:\fP
296
\fIeditable\fP true enables editing
305
.SS "void QwtCounter::setIncSteps (\fBQwtCounter::Button\fPbutton, intnSteps)"Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
309
\fIbutton\fP Button index
311
\fInSteps\fP Number of steps
320
.SS "void QwtCounter::setMaxValue (doublevalue)"Set the maximum value of the range
324
\fIvalue\fP Maximum value
329
\fBsetMinValue()\fP, maxVal()
333
.SS "void QwtCounter::setMinValue (doublevalue)"Set the minimum value of the range
337
\fIvalue\fP Minimum value
342
\fBsetMaxValue()\fP, \fBminValue()\fP
346
.SS "void QwtCounter::setNumButtons (intnumButtons)"
348
Specify the number of buttons on each side of the label. \fBParameters:\fP
350
\fInumButtons\fP Number of buttons
354
.SS "void QwtCounter::setStep (doublestepSize)"Set the step size
358
\fIstepSize\fP Step size
363
\fBQwtDoubleRange::setStep()\fP
368
Reimplemented from \fBQwtDoubleRange\fP.
369
.SS "void QwtCounter::setStepButton1 (intnSteps)"Set the number of increment steps for button 1
373
\fInSteps\fP Number of steps
377
.SS "void QwtCounter::setStepButton2 (intnSteps)"Set the number of increment steps for button 2
381
\fInSteps\fP Number of steps
385
.SS "void QwtCounter::setStepButton3 (intnSteps)"Set the number of increment steps for button 3
389
\fInSteps\fP Number of steps
393
.SS "void QwtCounter::setValue (doublevalue)\fC [virtual]\fP"
395
Set a new value. Calls \fBQwtDoubleRange::setValue\fP and does all visual updates.
399
\fIvalue\fP New value
404
\fBQwtDoubleRange::setValue()\fP
409
Reimplemented from \fBQwtDoubleRange\fP.
410
.SS "QSize QwtCounter::sizeHint () const\fC [virtual]\fP"
413
.SS "double QwtCounter::step () const"
415
returns the step size
417
Reimplemented from \fBQwtDoubleRange\fP.
418
.SS "int QwtCounter::stepButton1 () const"
420
returns the number of increment steps for button 1
421
.SS "int QwtCounter::stepButton2 () const"
423
returns the number of increment steps for button 2
424
.SS "int QwtCounter::stepButton3 () const"
426
returns the number of increment steps for button 3
427
.SS "double QwtCounter::value () const\fC [virtual]\fP"\fBReturns:\fP
434
Reimplemented from \fBQwtDoubleRange\fP.
435
.SS "void QwtCounter::valueChanged (doublevalue)\fC [signal]\fP"This signal is emitted when the counter's value has changed
439
\fIvalue\fP The new value
443
.SS "void QwtCounter::wheelEvent (QWheelEvent *event)\fC [protected, virtual]\fP"Handle wheel events
447
\fIevent\fP Wheel event
454
Generated automatically by Doxygen for Qwt User's Guide from the source code.