1
.TH "QwtCounter" 3 "26 Feb 2007" "Version 5.0.1" "Qwt User's Guide" \" -*- nroff -*-
9
Inherits \fBQwtDoubleRange\fP.
11
.SH "Detailed Description"
15
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.
17
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.
19
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).
24
#include '../include/qwt_counter.h>
28
cnt = new QwtCounter(parent, name);
30
cnt->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1.0
31
cnt->setNumButtons(2); // Two buttons each side
32
cnt->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step
33
cnt->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps
35
connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)));
41
Definition at line 60 of file qwt_counter.h.
46
.RI "enum \fBButton\fP { \fBButton1\fP, \fBButton2\fP, \fBButton3\fP, \fBButtonCnt\fP }"
53
.RI "void \fBbuttonReleased\fP (double value)"
56
.RI "void \fBvalueChanged\fP (double value)"
59
.SS "Public Member Functions"
63
.RI "\fBQwtCounter\fP (QWidget *parent=NULL)"
66
.RI "virtual \fB~QwtCounter\fP ()"
69
.RI "bool \fBeditable\fP () const "
72
.RI "void \fBsetEditable\fP (bool)"
75
.RI "void \fBsetNumButtons\fP (int n)"
78
.RI "int \fBnumButtons\fP () const "
81
.RI "void \fBsetIncSteps\fP (\fBQwtCounter::Button\fP btn, int nSteps)"
84
.RI "int \fBincSteps\fP (\fBQwtCounter::Button\fP btn) const "
87
.RI "virtual void \fBsetValue\fP (double)"
90
.RI "virtual QSize \fBsizeHint\fP () const "
93
.RI "virtual void \fBpolish\fP ()"
96
.RI "double \fBstep\fP () const "
99
.RI "void \fBsetStep\fP (double s)"
102
.RI "double \fBminVal\fP () const "
105
.RI "void \fBsetMinValue\fP (double m)"
108
.RI "double \fBmaxVal\fP () const "
111
.RI "void \fBsetMaxValue\fP (double m)"
114
.RI "void \fBsetStepButton1\fP (int nSteps)"
117
.RI "int \fBstepButton1\fP () const "
120
.RI "void \fBsetStepButton2\fP (int nSteps)"
123
.RI "int \fBstepButton2\fP () const "
126
.RI "void \fBsetStepButton3\fP (int nSteps)"
129
.RI "int \fBstepButton3\fP () const "
132
.RI "virtual double \fBvalue\fP () const "
135
.SS "Protected Member Functions"
139
.RI "virtual bool \fBevent\fP (QEvent *)"
142
.RI "virtual void \fBwheelEvent\fP (QWheelEvent *)"
145
.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *)"
148
.RI "virtual void \fBrangeChange\fP ()"
151
.SH "Member Enumeration Documentation"
153
.SS "enum \fBQwtCounter::Button\fP"
157
Definition at line 79 of file qwt_counter.h.
158
.SH "Constructor & Destructor Documentation"
160
.SS "QwtCounter::QwtCounter (QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
162
The default number of buttons is set to 2. The default increments are:
179
Definition at line 50 of file qwt_counter.cpp.
180
.SS "QwtCounter::~QwtCounter ()\fC [virtual]\fP"
184
Definition at line 143 of file qwt_counter.cpp.
185
.SH "Member Function Documentation"
187
.SS "void QwtCounter::buttonReleased (double value)\fC [signal]\fP"
189
This signal is emitted when a button has been released
193
\fIvalue\fP The new value
197
.SS "bool QwtCounter::editable () const"
199
returns whether the line edit is edatble. (default is yes)
201
Definition at line 198 of file qwt_counter.cpp.
202
.SS "bool QwtCounter::event (QEvent * e)\fC [protected, virtual]\fP"
204
Handle PolishRequest events
206
Definition at line 206 of file qwt_counter.cpp.
209
.SS "int QwtCounter::incSteps (\fBQwtCounter::Button\fP btn) const"
213
the number of steps by which a specified button increments the value or 0 if the button is invalid.
218
\fIbtn\fP One of \fCQwtCounter::Button1\fP, \fCQwtCounter::Button2\fP, \fCQwtCounter::Button3\fP
223
Definition at line 367 of file qwt_counter.cpp.
225
Referenced by stepButton1(), stepButton2(), and stepButton3().
226
.SS "void QwtCounter::keyPressEvent (QKeyEvent * e)\fC [protected, virtual]\fP"
231
Ctrl + Qt::Key_Home Step to \fBminValue()\fP
233
Ctrl + Qt::Key_End Step to \fBmaxValue()\fP
235
Qt::Key_Up Increment by incSteps(QwtCounter::Button1)
237
Qt::Key_Down Decrement by incSteps(QwtCounter::Button1)
239
Qt::Key_PageUp Increment by incSteps(QwtCounter::Button2)
241
Qt::Key_PageDown Decrement by incSteps(QwtCounter::Button2)
243
Shift + Qt::Key_PageUp Increment by incSteps(QwtCounter::Button3)
245
Shift + Qt::Key_PageDown Decrement by incSteps(QwtCounter::Button3)
249
Definition at line 236 of file qwt_counter.cpp.
251
References QwtDoubleRange::incValue(), QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), and setValue().
252
.SS "double QwtCounter::maxVal () const"
254
returns the maximum value of the range
256
Definition at line 574 of file qwt_counter.cpp.
258
References QwtDoubleRange::maxValue().
259
.SS "double QwtCounter::minVal () const"
261
returns the minimum value of the range
263
Definition at line 562 of file qwt_counter.cpp.
265
References QwtDoubleRange::minValue().
266
.SS "int QwtCounter::numButtons () const"
270
The number of buttons on each side of the widget.
275
Definition at line 466 of file qwt_counter.cpp.
276
.SS "void QwtCounter::polish ()\fC [virtual]\fP"
278
Sets the minimum width for the buttons
280
Definition at line 151 of file qwt_counter.cpp.
282
Referenced by event().
283
.SS "void QwtCounter::rangeChange ()\fC [protected, virtual]\fP"
285
Notify change of range.
287
This function updates the enabled property of all buttons contained in \fBQwtCounter\fP.
289
Reimplemented from \fBQwtDoubleRange\fP.
291
Definition at line 507 of file qwt_counter.cpp.
292
.SS "void QwtCounter::setEditable (bool editable)"
294
Allow/disallow the user to manually edit the value.
298
\fIeditable\fP true enables editing
308
Definition at line 185 of file qwt_counter.cpp.
309
.SS "void QwtCounter::setIncSteps (\fBQwtCounter::Button\fP btn, int nSteps)"
311
Specify the number of steps by which the value is incremented or decremented when a specified button is pushed.
315
\fIbtn\fP One of \fCQwtCounter::Button1\fP, \fCQwtCounter::Button2\fP, \fCQwtCounter::Button3\fP
317
\fInSteps\fP Number of steps
322
Definition at line 355 of file qwt_counter.cpp.
324
Referenced by setStepButton1(), setStepButton2(), and setStepButton3().
325
.SS "void QwtCounter::setMaxValue (double m)"
327
sets the maximum value of the range
329
Definition at line 580 of file qwt_counter.cpp.
331
References QwtDoubleRange::minValue(), QwtDoubleRange::setRange(), and step().
332
.SS "void QwtCounter::setMinValue (double m)"
334
sets the minimum value of the range
336
Definition at line 568 of file qwt_counter.cpp.
338
References QwtDoubleRange::maxValue(), QwtDoubleRange::setRange(), and step().
339
.SS "void QwtCounter::setNumButtons (int n)"
341
Specify the number of buttons on each side of the label.
345
\fIn\fP Number of buttons
350
Definition at line 441 of file qwt_counter.cpp.
351
.SS "void QwtCounter::setStep (double s)"
355
Reimplemented from \fBQwtDoubleRange\fP.
357
Definition at line 556 of file qwt_counter.cpp.
359
References QwtDoubleRange::setStep().
360
.SS "void QwtCounter::setStepButton1 (int nSteps)"
362
set the number of increment steps for button 1
364
Definition at line 586 of file qwt_counter.cpp.
366
References setIncSteps().
367
.SS "void QwtCounter::setStepButton2 (int nSteps)"
369
set the number of increment steps for button 2
371
Definition at line 598 of file qwt_counter.cpp.
373
References setIncSteps().
374
.SS "void QwtCounter::setStepButton3 (int nSteps)"
376
set the number of increment steps for button 3
378
Definition at line 610 of file qwt_counter.cpp.
380
References setIncSteps().
381
.SS "void QwtCounter::setValue (double v)\fC [virtual]\fP"
387
\fIv\fP new value Calls \fBQwtDoubleRange::setValue\fP and does all visual updates.
392
\fBQwtDoubleRange::setValue\fP
397
Reimplemented from \fBQwtDoubleRange\fP.
399
Definition at line 382 of file qwt_counter.cpp.
401
References QwtDoubleRange::setValue(), and value().
403
Referenced by keyPressEvent().
404
.SS "QSize QwtCounter::sizeHint () const\fC [virtual]\fP"
408
Definition at line 513 of file qwt_counter.cpp.
410
References QwtDoubleRange::maxValue(), QwtDoubleRange::minValue(), and step().
411
.SS "double QwtCounter::step () const"
413
returns the step size
415
Reimplemented from \fBQwtDoubleRange\fP.
417
Definition at line 550 of file qwt_counter.cpp.
419
References QwtDoubleRange::step().
421
Referenced by setMaxValue(), setMinValue(), and sizeHint().
422
.SS "int QwtCounter::stepButton1 () const"
424
returns the number of increment steps for button 1
426
Definition at line 592 of file qwt_counter.cpp.
428
References incSteps().
429
.SS "int QwtCounter::stepButton2 () const"
431
returns the number of increment steps for button 2
433
Definition at line 604 of file qwt_counter.cpp.
435
References incSteps().
436
.SS "int QwtCounter::stepButton3 () const"
438
returns the number of increment steps for button 3
440
Definition at line 616 of file qwt_counter.cpp.
442
References incSteps().
443
.SS "double QwtCounter::value () const\fC [virtual]\fP"
445
Returns the current value.
447
Reimplemented from \fBQwtDoubleRange\fP.
449
Definition at line 621 of file qwt_counter.cpp.
451
References QwtDoubleRange::value().
453
Referenced by setValue().
454
.SS "void QwtCounter::valueChanged (double value)\fC [signal]\fP"
456
This signal is emitted when the counter's value has changed
460
\fIvalue\fP The new value
467
Generated automatically by Doxygen for Qwt User's Guide from the source code.