1
.TH "QwtAbstractSlider" 3 "Fri Apr 15 2011" "Version 6.0.0" "Qwt User's Guide" \" -*- nroff -*-
7
An abstract base class for slider widgets.
13
\fC#include <qwt_abstract_slider.h>\fP
15
Inherits \fBQwtDoubleRange\fP.
17
Inherited by \fBQwtDial\fP, \fBQwtKnob\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
22
.RI "enum \fBScrollMode\fP { \fBScrNone\fP, \fBScrMouse\fP, \fBScrTimer\fP, \fBScrDirect\fP, \fBScrPage\fP }"
29
.RI "virtual void \fBsetValue\fP (double val)"
32
.RI "virtual void \fBfitValue\fP (double val)"
35
.RI "virtual void \fBincValue\fP (int steps)"
38
.RI "virtual void \fBsetReadOnly\fP (bool)"
45
.RI "void \fBvalueChanged\fP (double value)"
48
.RI "void \fBsliderPressed\fP ()"
51
.RI "void \fBsliderReleased\fP ()"
54
.RI "void \fBsliderMoved\fP (double value)"
57
.SS "Public Member Functions"
61
.RI "\fBQwtAbstractSlider\fP (Qt::Orientation, QWidget *parent=NULL)"
64
.RI "virtual \fB~QwtAbstractSlider\fP ()"
67
.RI "void \fBsetUpdateTime\fP (int t)"
70
.RI "void \fBstopMoving\fP ()"
73
.RI "void \fBsetTracking\fP (bool enable)"
76
.RI "virtual void \fBsetMass\fP (double val)"
79
.RI "virtual double \fBmass\fP () const "
82
.RI "virtual void \fBsetOrientation\fP (Qt::Orientation o)"
85
.RI "Qt::Orientation \fBorientation\fP () const "
88
.RI "bool \fBisReadOnly\fP () const "
91
.RI "bool \fBisValid\fP () const "
94
.RI "void \fBsetValid\fP (bool valid)"
97
.SS "Protected Member Functions"
101
.RI "virtual void \fBsetPosition\fP (const QPoint &)"
104
.RI "virtual void \fBvalueChange\fP ()"
107
.RI "virtual void \fBtimerEvent\fP (QTimerEvent *e)"
110
.RI "virtual void \fBmousePressEvent\fP (QMouseEvent *e)"
113
.RI "virtual void \fBmouseReleaseEvent\fP (QMouseEvent *e)"
116
.RI "virtual void \fBmouseMoveEvent\fP (QMouseEvent *e)"
119
.RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *e)"
122
.RI "virtual void \fBwheelEvent\fP (QWheelEvent *e)"
125
.RI "virtual double \fBgetValue\fP (const QPoint &p)=0"
128
.RI "virtual void \fBgetScrollMode\fP (const QPoint &pos, \fBScrollMode\fP &scrollMode, int &direction) const =0"
131
.RI "void \fBsetMouseOffset\fP (double)"
134
.RI "double \fBmouseOffset\fP () const "
137
.RI "int \fBscrollMode\fP () const "
140
.SH "Detailed Description"
142
An abstract base class for slider widgets.
144
\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.
145
.SH "Member Enumeration Documentation"
147
.SS "enum \fBQwtAbstractSlider::ScrollMode\fP"Scroll mode
151
\fBgetScrollMode()\fP
160
Scrolling switched off. Don't change the value.
162
\fB\fIScrMouse \fP\fP
163
Change the value while the user keeps the button pressed and moves the mouse.
165
\fB\fIScrTimer \fP\fP
166
Automatic scrolling. Increment the value in the specified direction as long as the user keeps the button pressed.
169
Automatic scrolling. Same as ScrTimer, but increment by page size.
170
.SH "Constructor & Destructor Documentation"
172
.SS "QwtAbstractSlider::QwtAbstractSlider (Qt::Orientationorientation, QWidget *parent = \fCNULL\fP)\fC [explicit]\fP"
174
Constructor. \fBParameters:\fP
176
\fIorientation\fP Orientation
178
\fIparent\fP Parent widget
182
.SS "QwtAbstractSlider::~QwtAbstractSlider ()\fC [virtual]\fP"
185
.SH "Member Function Documentation"
187
.SS "void QwtAbstractSlider::fitValue (doublevalue)\fC [virtual, slot]\fP"
189
Set the slider's value to the nearest integer multiple of the step size. \fBParameters:\fP
196
\fBsetValue()\fP, \fBincValue()\fP
201
Reimplemented from \fBQwtDoubleRange\fP.
202
.SS "virtual void QwtAbstractSlider::getScrollMode (const QPoint &pos, \fBScrollMode\fP &scrollMode, int &direction) const\fC [protected, pure virtual]\fP"
204
Determine what to do when the user presses a mouse button. 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.
208
\fIpos\fP point where the mouse was pressed
213
\fIscrollMode\fP The scrolling mode
215
\fIdirection\fP direction: 1, 0, or -1.
220
Implemented in \fBQwtDial\fP, \fBQwtKnob\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
221
.SS "virtual double QwtAbstractSlider::getValue (const QPoint &p)\fC [protected, pure virtual]\fP"
223
Determine the value corresponding to a specified poind. 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.
232
Implemented in \fBQwtDial\fP, \fBQwtKnob\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
233
.SS "void QwtAbstractSlider::incValue (intsteps)\fC [virtual, slot]\fP"
235
Increment the value by a specified number of steps. \fBParameters:\fP
237
\fIsteps\fP number of steps
247
Reimplemented from \fBQwtDoubleRange\fP.
248
.SS "bool QwtAbstractSlider::isReadOnly () const"In read only mode the slider can't be controlled by mouse or keyboard.
261
.SS "bool QwtAbstractSlider::isValid () const\fC [inline]\fP"\fBSee also:\fP
263
QwtDblRange::isValid()
268
Reimplemented from \fBQwtDoubleRange\fP.
269
.SS "void QwtAbstractSlider::keyPressEvent (QKeyEvent *e)\fC [protected, virtual]\fP"Handles key events
293
Reimplemented in \fBQwtCompass\fP, and \fBQwtDial\fP.
294
.SS "double QwtAbstractSlider::mass () const\fC [virtual]\fP"\fBReturns:\fP
306
Reimplemented in \fBQwtWheel\fP.
307
.SS "void QwtAbstractSlider::mouseMoveEvent (QMouseEvent *e)\fC [protected, virtual]\fP"Mouse Move Event handler
315
.SS "double QwtAbstractSlider::mouseOffset () const\fC [protected]\fP"\fBSee also:\fP
317
\fBsetMouseOffset()\fP
321
.SS "void QwtAbstractSlider::mousePressEvent (QMouseEvent *e)\fC [protected, virtual]\fP"Mouse press event handler
329
.SS "void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent *e)\fC [protected, virtual]\fP"Mouse Release Event handler
337
.SS "Qt::Orientation QwtAbstractSlider::orientation () const"\fBReturns:\fP
344
\fBsetOrientation()\fP
348
.SS "int QwtAbstractSlider::scrollMode () const\fC [protected]\fP"
351
.SS "void QwtAbstractSlider::setMass (doubleval)\fC [virtual]\fP"
353
Set the slider's mass for flywheel effect. 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.
355
Derived widgets may overload this function to make it public.
359
\fIval\fP New mass in kg
369
Reimplemented in \fBQwtWheel\fP.
370
.SS "void QwtAbstractSlider::setMouseOffset (doubleoffset)\fC [protected]\fP"\fBSee also:\fP
376
.SS "void QwtAbstractSlider::setOrientation (Qt::Orientationo)\fC [virtual]\fP"
378
Set the orientation. \fBParameters:\fP
380
\fIo\fP Orientation. Allowed values are Qt::Horizontal and Qt::Vertical.
385
Reimplemented in \fBQwtSlider\fP, and \fBQwtWheel\fP.
386
.SS "void QwtAbstractSlider::setPosition (const QPoint &p)\fC [protected, virtual]\fP"Move the slider to a specified point, adjust the value and emit signals if necessary.
387
.SS "void QwtAbstractSlider::setReadOnly (boolreadOnly)\fC [virtual, slot]\fP"En/Disable read only mode
389
In read only mode the slider can't be controlled by mouse or keyboard.
393
\fIreadOnly\fP Enables in case of true
402
.SS "void QwtAbstractSlider::setTracking (boolenable)"
404
Enables or disables tracking. 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:
408
the user releases the mouse button and the value has changed or
410
at the end of automatic scrolling.
412
Tracking is enabled by default.
416
\fIenable\fP \fCtrue\fP (enable) or \fCfalse\fP (disable) tracking.
420
.SS "void QwtAbstractSlider::setUpdateTime (intt)"
422
Specify the update interval for automatic scrolling. \fBParameters:\fP
424
\fIt\fP update interval in milliseconds
429
\fBgetScrollMode()\fP
433
.SS "void QwtAbstractSlider::setValid (boolvalid)\fC [inline]\fP"\fBParameters:\fP
435
\fIvalid\fP true/false
440
QwtDblRange::isValid()
445
Reimplemented from \fBQwtDoubleRange\fP.
446
.SS "void QwtAbstractSlider::setValue (doubleval)\fC [virtual, slot]\fP"
448
Move the slider to a specified value. This function can be used to move the slider to a value which is not an integer multiple of the step size.
462
Reimplemented from \fBQwtDoubleRange\fP.
463
.SS "void QwtAbstractSlider::sliderMoved (doublevalue)\fC [signal]\fP"This signal is emitted when the user moves the slider with the mouse.
467
\fIvalue\fP new value
471
.SS "void QwtAbstractSlider::sliderPressed ()\fC [signal]\fP"This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode).
472
.SS "void QwtAbstractSlider::sliderReleased ()\fC [signal]\fP"This signal is emitted when the user releases the movable part of the slider.
473
.SS "void QwtAbstractSlider::stopMoving ()"
475
Stop updating if automatic scrolling is active.
476
.SS "void QwtAbstractSlider::timerEvent (QTimerEvent *e)\fC [protected, virtual]\fP"Qt timer event
484
.SS "void QwtAbstractSlider::valueChange ()\fC [protected, virtual]\fP"Notify change of value
486
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.
488
Reimplemented from \fBQwtDoubleRange\fP.
490
Reimplemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP.
491
.SS "void QwtAbstractSlider::valueChanged (doublevalue)\fC [signal]\fP"
493
Notify a change of value. In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see \fBsetTracking()\fP ).
497
\fIvalue\fP new value
501
.SS "void QwtAbstractSlider::wheelEvent (QWheelEvent *e)\fC [protected, virtual]\fP"Wheel Event handler
512
Generated automatically by Doxygen for Qwt User's Guide from the source code.