1
.TH "QwtAbstractSlider" 3 "1 May 2008" "Version 5.1.0" "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::setUpdateTime (int t)"
181
Specify the update interval for automatic scrolling.
185
\fIt\fP update interval in milliseconds
190
\fBgetScrollMode()\fP
195
Definition at line 138 of file qwt_abstract_slider.cpp.
196
.SS "void QwtAbstractSlider::stopMoving ()"
198
Stop updating if automatic scrolling is active.
200
Definition at line 124 of file qwt_abstract_slider.cpp.
202
Referenced by fitValue(), incValue(), mousePressEvent(), mouseReleaseEvent(), setValue(), and timerEvent().
203
.SS "void QwtAbstractSlider::setTracking (bool enable)"
205
Enables or disables tracking.
207
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:
211
the user releases the mouse button and the value has changed or
213
at the end of automatic scrolling.
215
Tracking is enabled by default.
219
\fIenable\fP \fCtrue\fP (enable) or \fCfalse\fP (disable) tracking.
224
Definition at line 296 of file qwt_abstract_slider.cpp.
225
.SS "void QwtAbstractSlider::setMass (double val)\fC [virtual]\fP"
227
Set the slider's mass for flywheel effect.
229
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.
231
Derived widgets may overload this function to make it public.
235
\fIval\fP New mass in kg
245
Reimplemented in \fBQwtWheel\fP.
247
Definition at line 507 of file qwt_abstract_slider.cpp.
249
Referenced by QwtWheel::setMass().
250
.SS "double QwtAbstractSlider::mass () const\fC [virtual]\fP"
264
Reimplemented in \fBQwtWheel\fP.
266
Definition at line 521 of file qwt_abstract_slider.cpp.
268
Referenced by QwtWheel::mass().
269
.SS "void QwtAbstractSlider::setOrientation (Qt::Orientation o)\fC [virtual]\fP"
275
\fIo\fP Orientation. Allowed values are Qt::Horizontal and Qt::Vertical.
280
Reimplemented in \fBQwtSlider\fP, and \fBQwtWheel\fP.
282
Definition at line 108 of file qwt_abstract_slider.cpp.
284
Referenced by QwtWheel::setOrientation(), and QwtSlider::setOrientation().
285
.SS "Qt::Orientation QwtAbstractSlider::orientation () const"
294
\fBsetOrientation()\fP
299
Definition at line 117 of file qwt_abstract_slider.cpp.
301
Referenced by QwtSlider::drawSlider(), QwtSlider::drawThumb(), QwtWheel::drawWheel(), QwtWheel::drawWheelBackground(), QwtSlider::getScrollMode(), QwtWheel::getValue(), QwtSlider::getValue(), keyPressEvent(), QwtSlider::layoutSlider(), QwtWheel::minimumSizeHint(), QwtSlider::minimumSizeHint(), QwtWheel::setOrientation(), and QwtSlider::setOrientation().
302
.SS "bool QwtAbstractSlider::isReadOnly () const"
304
In read only mode the slider can't be controlled by mouse or keyboard.
318
Definition at line 98 of file qwt_abstract_slider.cpp.
320
Referenced by QwtDial::drawFocusIndicator(), QwtDial::keyPressEvent(), QwtCompass::keyPressEvent(), keyPressEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and wheelEvent().
321
.SS "bool QwtAbstractSlider::isValid () const\fC [inline]\fP"
330
Reimplemented from \fBQwtDoubleRange\fP.
332
Definition at line 87 of file qwt_abstract_slider.h.
334
References QwtDoubleRange::isValid().
336
Referenced by QwtDial::drawContents(), QwtKnob::drawKnob(), QwtAnalogClock::drawNeedle(), QwtCompass::drawScaleContents(), QwtSlider::drawSlider(), QwtDial::keyPressEvent(), keyPressEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and wheelEvent().
337
.SS "void QwtAbstractSlider::setValid (bool valid)\fC [inline]\fP"
346
Reimplemented from \fBQwtDoubleRange\fP.
348
Definition at line 92 of file qwt_abstract_slider.h.
350
References QwtDoubleRange::setValid().
352
Referenced by QwtAnalogClock::setTime().
353
.SS "void QwtAbstractSlider::setValue (double val)\fC [virtual, slot]\fP"
355
Move the slider to a specified value.
357
This function can be used to move the slider to a value which is not an integer multiple of the step size.
371
Reimplemented from \fBQwtDoubleRange\fP.
373
Definition at line 535 of file qwt_abstract_slider.cpp.
375
References QwtDoubleRange::setValue(), and stopMoving().
377
Referenced by QwtDial::keyPressEvent(), QwtCompass::keyPressEvent(), and QwtAnalogClock::setTime().
378
.SS "void QwtAbstractSlider::fitValue (double value)\fC [virtual, slot]\fP"
380
Set the slider's value to the nearest integer multiple of the step size.
389
\fBsetValue()\fP, \fBincValue()\fP
394
Reimplemented from \fBQwtDoubleRange\fP.
396
Definition at line 550 of file qwt_abstract_slider.cpp.
398
References QwtDoubleRange::fitValue(), and stopMoving().
399
.SS "void QwtAbstractSlider::incValue (int steps)\fC [virtual, slot]\fP"
401
Increment the value by a specified number of steps.
405
\fIsteps\fP number of steps
415
Reimplemented from \fBQwtDoubleRange\fP.
417
Definition at line 562 of file qwt_abstract_slider.cpp.
419
References QwtDoubleRange::incValue(), and stopMoving().
420
.SS "void QwtAbstractSlider::setReadOnly (bool readOnly)\fC [virtual, slot]\fP"
422
En/Disable read only mode
424
In read only mode the slider can't be controlled by mouse or keyboard.
428
\fIreadOnly\fP Enables in case of true
438
Definition at line 85 of file qwt_abstract_slider.cpp.
439
.SS "void QwtAbstractSlider::valueChanged (double value)\fC [signal]\fP"
441
Notify a change of value.
443
In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see \fBsetTracking()\fP ).
447
\fIvalue\fP new value
452
Referenced by valueChange().
453
.SS "void QwtAbstractSlider::sliderPressed ()\fC [signal]\fP"
455
This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode).
457
Referenced by mousePressEvent().
458
.SS "void QwtAbstractSlider::sliderReleased ()\fC [signal]\fP"
460
This signal is emitted when the user releases the movable part of the slider.
462
Referenced by mouseReleaseEvent().
463
.SS "void QwtAbstractSlider::sliderMoved (double value)\fC [signal]\fP"
465
This signal is emitted when the user moves the slider with the mouse.
469
\fIvalue\fP new value
474
Referenced by QwtDial::keyPressEvent(), keyPressEvent(), mouseMoveEvent(), and wheelEvent().
475
.SS "void QwtAbstractSlider::setPosition (const QPoint & p)\fC [protected, virtual]\fP"
477
Move the slider to a specified point, adjust the value and emit signals if necessary.
479
Definition at line 276 of file qwt_abstract_slider.cpp.
481
References QwtDoubleRange::fitValue(), and getValue().
483
Referenced by mouseMoveEvent(), and mouseReleaseEvent().
484
.SS "void QwtAbstractSlider::valueChange ()\fC [protected, virtual]\fP"
486
Notify change of value
488
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.
490
Reimplemented from \fBQwtDoubleRange\fP.
492
Reimplemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
494
Definition at line 484 of file qwt_abstract_slider.cpp.
496
References QwtDoubleRange::value(), and valueChanged().
498
Referenced by QwtWheel::valueChange(), QwtSlider::valueChange(), and QwtDial::valueChange().
499
.SS "void QwtAbstractSlider::timerEvent (QTimerEvent * e)\fC [protected, virtual]\fP"
510
Definition at line 417 of file qwt_abstract_slider.cpp.
512
References QwtDoubleRange::exactValue(), QwtDoubleRange::fitValue(), QwtDoubleRange::incPages(), QwtDoubleRange::step(), stopMoving(), and QwtDoubleRange::value().
513
.SS "void QwtAbstractSlider::mousePressEvent (QMouseEvent * e)\fC [protected, virtual]\fP"
515
Mouse press event handler.
517
Definition at line 147 of file qwt_abstract_slider.cpp.
519
References getScrollMode(), getValue(), isReadOnly(), isValid(), sliderPressed(), stopMoving(), and QwtDoubleRange::value().
520
.SS "void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent * e)\fC [protected, virtual]\fP"
522
Mouse Release Event handler.
524
Definition at line 196 of file qwt_abstract_slider.cpp.
526
References QwtDoubleRange::fitValue(), QwtDoubleRange::incPages(), isReadOnly(), isValid(), setPosition(), sliderReleased(), QwtDoubleRange::step(), stopMoving(), and QwtDoubleRange::value().
527
.SS "void QwtAbstractSlider::mouseMoveEvent (QMouseEvent * e)\fC [protected, virtual]\fP"
529
Mouse Move Event handler
538
Definition at line 305 of file qwt_abstract_slider.cpp.
540
References QwtDoubleRange::exactPrevValue(), QwtDoubleRange::exactValue(), isReadOnly(), isValid(), QwtDoubleRange::prevValue(), setPosition(), sliderMoved(), and QwtDoubleRange::value().
541
.SS "void QwtAbstractSlider::keyPressEvent (QKeyEvent * e)\fC [protected, virtual]\fP"
567
Reimplemented in \fBQwtCompass\fP, and \fBQwtDial\fP.
569
Definition at line 371 of file qwt_abstract_slider.cpp.
571
References QwtDoubleRange::incValue(), isReadOnly(), isValid(), orientation(), QwtDoubleRange::prevValue(), sliderMoved(), and QwtDoubleRange::value().
572
.SS "void QwtAbstractSlider::wheelEvent (QWheelEvent * e)\fC [protected, virtual]\fP"
583
Definition at line 336 of file qwt_abstract_slider.cpp.
585
References getScrollMode(), QwtDoubleRange::incPages(), isReadOnly(), isValid(), QwtDoubleRange::prevValue(), sliderMoved(), and QwtDoubleRange::value().
586
.SS "virtual double QwtAbstractSlider::getValue (const QPoint & p)\fC [protected, pure virtual]\fP"
588
Determine the value corresponding to a specified poind.
590
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.
599
Implemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
601
Referenced by mousePressEvent(), and setPosition().
602
.SS "virtual void QwtAbstractSlider::getScrollMode (const QPoint & p, int & scrollMode, int & direction)\fC [protected, pure virtual]\fP"
604
Determine what to do when the user presses a mouse button.
606
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:
607
.IP "\fBQwtAbstractSlider::ScrNone \fP" 1c
608
Scrolling switched off. Don't change the value.
609
.IP "\fBQwtAbstractSlider::ScrMouse \fP" 1c
610
Change the value while the user keeps the button pressed and moves the mouse.
611
.IP "\fBQwtAbstractSlider::ScrTimer \fP" 1c
612
Automatic scrolling. Increment the value in the specified direction as long as the user keeps the button pressed.
613
.IP "\fBQwtAbstractSlider::ScrPage \fP" 1c
614
Automatic scrolling. Same as ScrTimer, but increment by page size.
619
\fIp\fP point where the mouse was pressed
624
\fIscrollMode\fP The scrolling mode
626
\fIdirection\fP direction: 1, 0, or -1.
631
Implemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
633
Referenced by mousePressEvent(), and wheelEvent().
637
Generated automatically by Doxygen for Qwt User's Guide from the source code.