1
.TH "QwtAbstractSlider" 3 "26 Feb 2007" "Version 5.0.1" "Qwt User's Guide" \" -*- nroff -*-
9
Inherits \fBQwtDoubleRange\fP.
11
Inherited by \fBQwtDial\fP, \fBQwtKnob\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
13
.SH "Detailed Description"
15
An abstract base class for slider widgets.
17
\fBQwtAbstractSlider\fP is a base class for slider widgets. It handles mouse events and updates the slider's value accordingly. Derived classes only have to implement the \fBgetValue()\fP and \fBgetScrollMode()\fP members, and should react to a \fBvalueChange()\fP, which normally requires repainting.
19
Definition at line 28 of file qwt_abstract_slider.h.
24
.RI "enum \fBScrollMode\fP { \fBScrNone\fP, \fBScrMouse\fP, \fBScrTimer\fP, \fBScrDirect\fP, \fBScrPage\fP }"
31
.RI "virtual void \fBsetValue\fP (double val)"
34
.RI "virtual void \fBfitValue\fP (double val)"
37
.RI "virtual void \fBincValue\fP (int steps)"
40
.RI "virtual void \fBsetReadOnly\fP (bool)"
47
.RI "void \fBvalueChanged\fP (double value)"
50
.RI "void \fBsliderPressed\fP ()"
53
.RI "void \fBsliderReleased\fP ()"
56
.RI "void \fBsliderMoved\fP (double value)"
59
.SS "Public Member Functions"
63
.RI "\fBQwtAbstractSlider\fP (Qt::Orientation, QWidget *parent=NULL)"
66
.RI "virtual \fB~QwtAbstractSlider\fP ()"
69
.RI "void \fBsetUpdateTime\fP (int t)"
72
.RI "void \fBstopMoving\fP ()"
75
.RI "void \fBsetTracking\fP (bool enable)"
78
.RI "virtual void \fBsetMass\fP (double val)"
81
.RI "virtual double \fBmass\fP () const "
84
.RI "virtual void \fBsetOrientation\fP (Qt::Orientation o)"
87
.RI "Qt::Orientation \fBorientation\fP () const "
90
.RI "bool \fBisReadOnly\fP () const "
93
.RI "bool \fBisValid\fP () const "
96
.RI "void \fBsetValid\fP (bool valid)"
99
.SS "Protected Member Functions"
103
.RI "virtual void \fBsetPosition\fP (const QPoint &)"
106
.RI "virtual void \fBvalueChange\fP ()"
109
.RI "virtual void \fBtimerEvent\fP (QTimerEvent *e)"
112
.RI "virtual void \fBmousePressEvent\fP (QMouseEvent *e)"
115
.RI "virtual void \fBmouseReleaseEvent\fP (QMouseEvent *e)"
118
.RI "virtual void \fBmouseMoveEvent\fP (QMouseEvent *e)"
121
.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *e)"
124
.RI "virtual void \fBwheelEvent\fP (QWheelEvent *e)"
127
.RI "virtual double \fBgetValue\fP (const QPoint &p)=0"
130
.RI "virtual void \fBgetScrollMode\fP (const QPoint &p, int &scrollMode, int &direction)=0"
133
.RI "void \fBsetMouseOffset\fP (double)"
136
.RI "double \fBmouseOffset\fP () const "
139
.RI "int \fBscrollMode\fP () const "
142
.SH "Member Enumeration Documentation"
144
.SS "enum \fBQwtAbstractSlider::ScrollMode\fP"
150
\fBgetScrollMode()\fP
155
Definition at line 50 of file qwt_abstract_slider.h.
156
.SH "Constructor & Destructor Documentation"
158
.SS "QwtAbstractSlider::QwtAbstractSlider (Qt::Orientation orientation, QWidget * parent = \fCNULL\fP)\fC [explicit]\fP"
164
\fIorientation\fP Orientation
166
\fIparent\fP Parent widget
171
Definition at line 54 of file qwt_abstract_slider.cpp.
172
.SS "QwtAbstractSlider::~QwtAbstractSlider ()\fC [virtual]\fP"
176
Definition at line 68 of file qwt_abstract_slider.cpp.
177
.SH "Member Function Documentation"
179
.SS "void QwtAbstractSlider::fitValue (double value)\fC [virtual, slot]\fP"
181
Set the slider's value to the nearest integer multiple of the step size.
190
\fBsetValue()\fP, \fBincValue()\fP
195
Reimplemented from \fBQwtDoubleRange\fP.
197
Definition at line 550 of file qwt_abstract_slider.cpp.
199
References QwtDoubleRange::fitValue(), and stopMoving().
200
.SS "virtual void QwtAbstractSlider::getScrollMode (const QPoint & p, int & scrollMode, int & direction)\fC [protected, pure virtual]\fP"
202
Determine what to do when the user presses a mouse button.
204
This function is abstract and has to be implemented by derived classes. It is called on a mousePress event. The derived class can determine what should happen next in dependence of the position where the mouse was pressed by returning scrolling mode and direction. \fBQwtAbstractSlider\fP knows the following modes:
205
.IP "\fBQwtAbstractSlider::ScrNone \fP" 1c
206
Scrolling switched off. Don't change the value.
207
.IP "\fBQwtAbstractSlider::ScrMouse \fP" 1c
208
Change the value while the user keeps the button pressed and moves the mouse.
209
.IP "\fBQwtAbstractSlider::ScrTimer \fP" 1c
210
Automatic scrolling. Increment the value in the specified direction as long as the user keeps the button pressed.
211
.IP "\fBQwtAbstractSlider::ScrPage \fP" 1c
212
Automatic scrolling. Same as ScrTimer, but increment by page size.
217
\fIp\fP point where the mouse was pressed
222
\fIscrollMode\fP The scrolling mode
224
\fIdirection\fP direction: 1, 0, or -1.
229
Implemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
231
Referenced by mousePressEvent(), and wheelEvent().
232
.SS "virtual double QwtAbstractSlider::getValue (const QPoint & p)\fC [protected, pure virtual]\fP"
234
Determine the value corresponding to a specified poind.
236
This is an abstract virtual function which is called when the user presses or releases a mouse button or moves the mouse. It has to be implemented by the derived class.
245
Implemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
247
Referenced by mousePressEvent(), and setPosition().
248
.SS "void QwtAbstractSlider::incValue (int steps)\fC [virtual, slot]\fP"
250
Increment the value by a specified number of steps.
254
\fIsteps\fP number of steps
264
Reimplemented from \fBQwtDoubleRange\fP.
266
Definition at line 562 of file qwt_abstract_slider.cpp.
268
References QwtDoubleRange::incValue(), and stopMoving().
269
.SS "bool QwtAbstractSlider::isReadOnly () const"
271
In read only mode the slider can't be controlled by mouse or keyboard.
285
Definition at line 98 of file qwt_abstract_slider.cpp.
287
Referenced by QwtDial::drawFocusIndicator(), QwtDial::keyPressEvent(), QwtCompass::keyPressEvent(), keyPressEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and wheelEvent().
288
.SS "bool QwtAbstractSlider::isValid () const\fC [inline]\fP"
297
Reimplemented from \fBQwtDoubleRange\fP.
299
Definition at line 87 of file qwt_abstract_slider.h.
301
References QwtDoubleRange::isValid().
303
Referenced by QwtDial::drawContents(), QwtKnob::drawKnob(), QwtAnalogClock::drawNeedle(), QwtCompass::drawScaleContents(), QwtSlider::drawSlider(), QwtDial::keyPressEvent(), keyPressEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and wheelEvent().
304
.SS "void QwtAbstractSlider::keyPressEvent (QKeyEvent * e)\fC [protected, virtual]\fP"
330
Reimplemented in \fBQwtCompass\fP, and \fBQwtDial\fP.
332
Definition at line 371 of file qwt_abstract_slider.cpp.
334
References isReadOnly(), isValid(), and orientation().
335
.SS "double QwtAbstractSlider::mass () const\fC [virtual]\fP"
349
Reimplemented in \fBQwtWheel\fP.
351
Definition at line 521 of file qwt_abstract_slider.cpp.
353
Referenced by QwtWheel::mass().
354
.SS "void QwtAbstractSlider::mouseMoveEvent (QMouseEvent * e)\fC [protected, virtual]\fP"
356
Mouse Move Event handler
365
Definition at line 305 of file qwt_abstract_slider.cpp.
367
References QwtDoubleRange::exactPrevValue(), QwtDoubleRange::exactValue(), isReadOnly(), isValid(), QwtDoubleRange::prevValue(), setPosition(), sliderMoved(), and QwtDoubleRange::value().
368
.SS "void QwtAbstractSlider::mousePressEvent (QMouseEvent * e)\fC [protected, virtual]\fP"
370
Mouse press event handler.
372
Definition at line 147 of file qwt_abstract_slider.cpp.
374
References getScrollMode(), getValue(), isReadOnly(), isValid(), sliderPressed(), stopMoving(), and QwtDoubleRange::value().
375
.SS "void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent * e)\fC [protected, virtual]\fP"
377
Mouse Release Event handler.
379
Definition at line 196 of file qwt_abstract_slider.cpp.
381
References QwtDoubleRange::fitValue(), QwtDoubleRange::incPages(), isReadOnly(), isValid(), setPosition(), sliderReleased(), QwtDoubleRange::step(), stopMoving(), and QwtDoubleRange::value().
382
.SS "Qt::Orientation QwtAbstractSlider::orientation () const"
391
\fBsetOrientation()\fP
396
Definition at line 117 of file qwt_abstract_slider.cpp.
398
Referenced by QwtSlider::drawSlider(), QwtSlider::drawThumb(), QwtWheel::drawWheel(), QwtWheel::drawWheelBackground(), QwtWheel::getValue(), QwtSlider::getValue(), keyPressEvent(), QwtSlider::layoutSlider(), QwtWheel::minimumSizeHint(), QwtSlider::minimumSizeHint(), QwtWheel::setOrientation(), and QwtSlider::setOrientation().
399
.SS "void QwtAbstractSlider::setMass (double val)\fC [virtual]\fP"
401
Set the slider's mass for flywheel effect.
403
If the slider's mass is greater then 0, it will continue to move after the mouse button has been released. Its speed decreases with time at a rate depending on the slider's mass. A large mass means that it will continue to move for a long time.
405
Derived widgets may overload this function to make it public.
409
\fIval\fP New mass in kg
419
Reimplemented in \fBQwtWheel\fP.
421
Definition at line 507 of file qwt_abstract_slider.cpp.
423
Referenced by QwtWheel::setMass().
424
.SS "void QwtAbstractSlider::setOrientation (Qt::Orientation o)\fC [virtual]\fP"
430
\fIo\fP Orientation. Allowed values are Qt::Horizontal and Qt::Vertical.
435
Reimplemented in \fBQwtSlider\fP, and \fBQwtWheel\fP.
437
Definition at line 108 of file qwt_abstract_slider.cpp.
439
Referenced by QwtWheel::setOrientation(), and QwtSlider::setOrientation().
440
.SS "void QwtAbstractSlider::setPosition (const QPoint & p)\fC [protected, virtual]\fP"
442
Move the slider to a specified point, adjust the value and emit signals if necessary.
444
Definition at line 276 of file qwt_abstract_slider.cpp.
446
References QwtDoubleRange::fitValue(), and getValue().
448
Referenced by mouseMoveEvent(), and mouseReleaseEvent().
449
.SS "void QwtAbstractSlider::setReadOnly (bool readOnly)\fC [virtual, slot]\fP"
451
En/Disable read only mode
453
In read only mode the slider can't be controlled by mouse or keyboard.
457
\fIreadOnly\fP Enables in case of true
467
Definition at line 85 of file qwt_abstract_slider.cpp.
468
.SS "void QwtAbstractSlider::setTracking (bool enable)"
470
Enables or disables tracking.
472
If tracking is enabled, the slider emits a \fBvalueChanged()\fP signal whenever its value changes (the default behaviour). If tracking is disabled, the value changed() signal will only be emitted if:
476
the user releases the mouse button and the value has changed or
478
at the end of automatic scrolling.
480
Tracking is enabled by default.
484
\fIenable\fP \fCtrue\fP (enable) or \fCfalse\fP (disable) tracking.
489
Definition at line 296 of file qwt_abstract_slider.cpp.
490
.SS "void QwtAbstractSlider::setUpdateTime (int t)"
492
Specify the update interval for automatic scrolling.
496
\fIt\fP update interval in milliseconds
501
\fBgetScrollMode()\fP
506
Definition at line 138 of file qwt_abstract_slider.cpp.
507
.SS "void QwtAbstractSlider::setValid (bool valid)\fC [inline]\fP"
516
Reimplemented from \fBQwtDoubleRange\fP.
518
Definition at line 92 of file qwt_abstract_slider.h.
520
References QwtDoubleRange::setValid().
521
.SS "void QwtAbstractSlider::setValue (double val)\fC [virtual, slot]\fP"
523
Move the slider to a specified value.
525
This function can be used to move the slider to a value which is not an integer multiple of the step size.
539
Reimplemented from \fBQwtDoubleRange\fP.
541
Definition at line 535 of file qwt_abstract_slider.cpp.
543
References QwtDoubleRange::setValue(), and stopMoving().
545
Referenced by QwtDial::keyPressEvent(), and QwtAnalogClock::setTime().
546
.SS "void QwtAbstractSlider::sliderMoved (double value)\fC [signal]\fP"
548
This signal is emitted when the user moves the slider with the mouse.
552
\fIvalue\fP new value
557
Referenced by mouseMoveEvent(), and wheelEvent().
558
.SS "void QwtAbstractSlider::sliderPressed ()\fC [signal]\fP"
560
This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode).
562
Referenced by mousePressEvent().
563
.SS "void QwtAbstractSlider::sliderReleased ()\fC [signal]\fP"
565
This signal is emitted when the user releases the movable part of the slider.
567
Referenced by mouseReleaseEvent().
568
.SS "void QwtAbstractSlider::stopMoving ()"
570
Stop updating if automatic scrolling is active.
572
Definition at line 124 of file qwt_abstract_slider.cpp.
574
Referenced by fitValue(), incValue(), mousePressEvent(), mouseReleaseEvent(), setValue(), and timerEvent().
575
.SS "void QwtAbstractSlider::timerEvent (QTimerEvent * e)\fC [protected, virtual]\fP"
586
Definition at line 417 of file qwt_abstract_slider.cpp.
588
References QwtDoubleRange::exactValue(), QwtDoubleRange::fitValue(), QwtDoubleRange::incPages(), QwtDoubleRange::step(), stopMoving(), and QwtDoubleRange::value().
589
.SS "void QwtAbstractSlider::valueChange ()\fC [protected, virtual]\fP"
591
Notify change of value
593
This function can be reimplemented by derived classes in order to keep track of changes, i.e. repaint the widget. The default implementation emits a \fBvalueChanged()\fP signal if tracking is enabled.
595
Reimplemented from \fBQwtDoubleRange\fP.
597
Reimplemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
599
Definition at line 484 of file qwt_abstract_slider.cpp.
601
References QwtDoubleRange::value(), and valueChanged().
603
Referenced by QwtWheel::valueChange(), QwtSlider::valueChange(), and QwtDial::valueChange().
604
.SS "void QwtAbstractSlider::valueChanged (double value)\fC [signal]\fP"
606
Notify a change of value.
608
In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see \fBsetTracking()\fP ).
612
\fIvalue\fP new value
617
Referenced by valueChange().
618
.SS "void QwtAbstractSlider::wheelEvent (QWheelEvent * e)\fC [protected, virtual]\fP"
629
Definition at line 336 of file qwt_abstract_slider.cpp.
631
References getScrollMode(), QwtDoubleRange::incPages(), isReadOnly(), isValid(), QwtDoubleRange::prevValue(), sliderMoved(), and QwtDoubleRange::value().
635
Generated automatically by Doxygen for Qwt User's Guide from the source code.