.TH "QwtAbstractSlider" 3 "Mon Aug 1 2011" "Version 5.2.2" "Qwt User's Guide" \" -*- nroff -*- .ad l .nh .SH NAME QwtAbstractSlider \- .PP An abstract base class for slider widgets. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBQwtDoubleRange\fP. .PP Inherited by \fBQwtDial\fP, \fBQwtKnob\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP. .SS "Public Types" .in +1c .ti -1c .RI "enum \fBScrollMode\fP { \fBScrNone\fP, \fBScrMouse\fP, \fBScrTimer\fP, \fBScrDirect\fP, \fBScrPage\fP }" .br .in -1c .SS "Public Slots" .in +1c .ti -1c .RI "virtual void \fBfitValue\fP (double val)" .br .ti -1c .RI "virtual void \fBincValue\fP (int steps)" .br .ti -1c .RI "virtual void \fBsetReadOnly\fP (bool)" .br .ti -1c .RI "virtual void \fBsetValue\fP (double val)" .br .in -1c .SS "Signals" .in +1c .ti -1c .RI "void \fBsliderMoved\fP (double value)" .br .ti -1c .RI "void \fBsliderPressed\fP ()" .br .ti -1c .RI "void \fBsliderReleased\fP ()" .br .ti -1c .RI "void \fBvalueChanged\fP (double value)" .br .in -1c .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual void \fBincPages\fP (int)" .br .ti -1c .RI "bool \fBisReadOnly\fP () const " .br .ti -1c .RI "bool \fBisValid\fP () const " .br .ti -1c .RI "virtual double \fBmass\fP () const " .br .ti -1c .RI "double \fBmaxValue\fP () const " .br .ti -1c .RI "double \fBminValue\fP () const " .br .ti -1c .RI "Qt::Orientation \fBorientation\fP () const " .br .ti -1c .RI "int \fBpageSize\fP () const " .br .ti -1c .RI "bool \fBperiodic\fP () const " .br .ti -1c .RI "\fBQwtAbstractSlider\fP (Qt::Orientation, QWidget *parent=NULL)" .br .ti -1c .RI "virtual void \fBsetMass\fP (double val)" .br .ti -1c .RI "virtual void \fBsetOrientation\fP (Qt::Orientation o)" .br .ti -1c .RI "void \fBsetPeriodic\fP (bool tf)" .br .ti -1c .RI "void \fBsetRange\fP (double vmin, double vmax, double vstep=0.0, int pagesize=1)" .br .ti -1c .RI "void \fBsetStep\fP (double)" .br .ti -1c .RI "void \fBsetTracking\fP (bool enable)" .br .ti -1c .RI "void \fBsetUpdateTime\fP (int t)" .br .ti -1c .RI "void \fBsetValid\fP (bool valid)" .br .ti -1c .RI "double \fBstep\fP () const " .br .ti -1c .RI "void \fBstopMoving\fP ()" .br .ti -1c .RI "double \fBvalue\fP () const " .br .ti -1c .RI "virtual \fB~QwtAbstractSlider\fP ()" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "double \fBexactPrevValue\fP () const " .br .ti -1c .RI "double \fBexactValue\fP () const " .br .ti -1c .RI "virtual void \fBgetScrollMode\fP (const QPoint &p, int &scrollMode, int &direction)=0" .br .ti -1c .RI "virtual double \fBgetValue\fP (const QPoint &p)=0" .br .ti -1c .RI "virtual void \fBkeyPressEvent\fP (QKeyEvent *e)" .br .ti -1c .RI "virtual void \fBmouseMoveEvent\fP (QMouseEvent *e)" .br .ti -1c .RI "double \fBmouseOffset\fP () const " .br .ti -1c .RI "virtual void \fBmousePressEvent\fP (QMouseEvent *e)" .br .ti -1c .RI "virtual void \fBmouseReleaseEvent\fP (QMouseEvent *e)" .br .ti -1c .RI "double \fBprevValue\fP () const " .br .ti -1c .RI "virtual void \fBrangeChange\fP ()" .br .ti -1c .RI "int \fBscrollMode\fP () const " .br .ti -1c .RI "void \fBsetMouseOffset\fP (double)" .br .ti -1c .RI "virtual void \fBsetPosition\fP (const QPoint &)" .br .ti -1c .RI "virtual void \fBstepChange\fP ()" .br .ti -1c .RI "virtual void \fBtimerEvent\fP (QTimerEvent *e)" .br .ti -1c .RI "virtual void \fBvalueChange\fP ()" .br .ti -1c .RI "virtual void \fBwheelEvent\fP (QWheelEvent *e)" .br .in -1c .SH "Detailed Description" .PP An abstract base class for slider widgets. \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. .SH "Member Enumeration Documentation" .PP .SS "enum \fBQwtAbstractSlider::ScrollMode\fP"Scroll mode .PP \fBSee also:\fP .RS 4 \fBgetScrollMode()\fP .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "QwtAbstractSlider::QwtAbstractSlider (Qt::Orientationorientation, QWidget *parent = \fCNULL\fP)\fC [explicit]\fP" .PP Constructor. \fBParameters:\fP .RS 4 \fIorientation\fP Orientation .br \fIparent\fP Parent widget .RE .PP .SS "QwtAbstractSlider::~QwtAbstractSlider ()\fC [virtual]\fP" .PP Destructor. .SH "Member Function Documentation" .PP .SS "double QwtDoubleRange::exactPrevValue () const\fC [protected, inherited]\fP" .PP Returns the exact previous value. .SS "double QwtDoubleRange::exactValue () const\fC [protected, inherited]\fP" .PP Returns the exact value. The exact value is the value which \fBQwtDoubleRange::value\fP would return if the value were not adjusted to the step raster. It differs from the current value only if \fBQwtDoubleRange::fitValue\fP or \fBQwtDoubleRange::incValue\fP have been used before. This function is intended for internal use in derived classes. .SS "void QwtAbstractSlider::fitValue (doublevalue)\fC [virtual, slot]\fP" .PP Set the slider's value to the nearest integer multiple of the step size. \fBParameters:\fP .RS 4 \fIvalue\fP Value .RE .PP \fBSee also:\fP .RS 4 \fBsetValue()\fP, \fBincValue()\fP .RE .PP .PP Reimplemented from \fBQwtDoubleRange\fP. .SS "virtual void QwtAbstractSlider::getScrollMode (const QPoint &p, int &scrollMode, int &direction)\fC [protected, pure virtual]\fP" .PP 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. \fBQwtAbstractSlider\fP knows the following modes: .IP "\fBQwtAbstractSlider::ScrNone \fP" 1c Scrolling switched off. Don't change the value. .IP "\fBQwtAbstractSlider::ScrMouse \fP" 1c Change the value while the user keeps the button pressed and moves the mouse. .IP "\fBQwtAbstractSlider::ScrTimer \fP" 1c Automatic scrolling. Increment the value in the specified direction as long as the user keeps the button pressed. .IP "\fBQwtAbstractSlider::ScrPage \fP" 1c Automatic scrolling. Same as ScrTimer, but increment by page size. .PP .PP \fBParameters:\fP .RS 4 \fIp\fP point where the mouse was pressed .RE .PP \fBReturn values:\fP .RS 4 \fIscrollMode\fP The scrolling mode .br \fIdirection\fP direction: 1, 0, or \-1. .RE .PP .PP Implemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP. .SS "virtual double QwtAbstractSlider::getValue (const QPoint &p)\fC [protected, pure virtual]\fP" .PP 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. .PP \fBParameters:\fP .RS 4 \fIp\fP point .RE .PP .PP Implemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP. .SS "void QwtDoubleRange::incPages (intnPages)\fC [virtual, inherited]\fP" .PP Increment the value by a specified number of pages. \fBParameters:\fP .RS 4 \fInPages\fP Number of pages to increment. A negative number decrements the value. .RE .PP \fBWarning:\fP .RS 4 The Page size is specified in the constructor. .RE .PP .SS "void QwtAbstractSlider::incValue (intsteps)\fC [virtual, slot]\fP" .PP Increment the value by a specified number of steps. \fBParameters:\fP .RS 4 \fIsteps\fP number of steps .RE .PP \fBSee also:\fP .RS 4 \fBsetValue()\fP .RE .PP .PP Reimplemented from \fBQwtDoubleRange\fP. .SS "bool QwtAbstractSlider::isReadOnly () const"In read only mode the slider can't be controlled by mouse or keyboard. .PP \fBReturns:\fP .RS 4 true if read only .RE .PP \fBSee also:\fP .RS 4 \fBsetReadOnly()\fP .RE .PP .SS "bool QwtAbstractSlider::isValid () const\fC [inline]\fP"\fBSee also:\fP .RS 4 QwtDblRange::isValid() .RE .PP .PP Reimplemented from \fBQwtDoubleRange\fP. .SS "void QwtAbstractSlider::keyPressEvent (QKeyEvent *e)\fC [protected, virtual]\fP"Handles key events .PP .IP "\(bu" 2 Key_Down, KeyLeft .br Decrement by 1 .IP "\(bu" 2 Key_Up, Key_Right .br Increment by 1 .PP .PP \fBParameters:\fP .RS 4 \fIe\fP Key event .RE .PP \fBSee also:\fP .RS 4 \fBisReadOnly()\fP .RE .PP .PP Reimplemented in \fBQwtCompass\fP, and \fBQwtDial\fP. .SS "double QwtAbstractSlider::mass () const\fC [virtual]\fP"\fBReturns:\fP .RS 4 mass .RE .PP \fBSee also:\fP .RS 4 \fBsetMass()\fP .RE .PP .PP Reimplemented in \fBQwtWheel\fP. .SS "double QwtDoubleRange::maxValue () const\fC [inherited]\fP" .PP Returns the value of the second border of the range. maxValue returns the value which has been specified as the second parameter in \fBQwtDoubleRange::setRange\fP. .PP \fBSee also:\fP .RS 4 \fBsetRange()\fP .RE .PP .SS "double QwtDoubleRange::minValue () const\fC [inherited]\fP" .PP Returns the value at the first border of the range. minValue returns the value which has been specified as the first parameter in \fBsetRange()\fP. .PP \fBSee also:\fP .RS 4 \fBsetRange()\fP .RE .PP .SS "void QwtAbstractSlider::mouseMoveEvent (QMouseEvent *e)\fC [protected, virtual]\fP"Mouse Move Event handler .PP \fBParameters:\fP .RS 4 \fIe\fP Mouse event .RE .PP .SS "void QwtAbstractSlider::mousePressEvent (QMouseEvent *e)\fC [protected, virtual]\fP"Mouse press event handler .PP \fBParameters:\fP .RS 4 \fIe\fP Mouse event .RE .PP .SS "void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent *e)\fC [protected, virtual]\fP"Mouse Release Event handler .PP \fBParameters:\fP .RS 4 \fIe\fP Mouse event .RE .PP .SS "Qt::Orientation QwtAbstractSlider::orientation () const"\fBReturns:\fP .RS 4 Orientation .RE .PP \fBSee also:\fP .RS 4 \fBsetOrientation()\fP .RE .PP .SS "int QwtDoubleRange::pageSize () const\fC [inherited]\fP" .PP Returns the page size in steps. .SS "bool QwtDoubleRange::periodic () const\fC [inherited]\fP" .PP Returns true if the range is periodic. \fBSee also:\fP .RS 4 \fBsetPeriodic()\fP .RE .PP .SS "double QwtDoubleRange::prevValue () const\fC [protected, inherited]\fP" .PP Returns the previous value. .SS "void QwtDoubleRange::rangeChange ()\fC [protected, virtual, inherited]\fP" .PP Notify a change of the range. This virtual function is called whenever the range changes. The default implementation does nothing. .PP Reimplemented in \fBQwtCounter\fP, \fBQwtDial\fP, and \fBQwtSlider\fP. .SS "void QwtAbstractSlider::setMass (doubleval)\fC [virtual]\fP" .PP 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. .PP Derived widgets may overload this function to make it public. .PP \fBParameters:\fP .RS 4 \fIval\fP New mass in kg .RE .PP \fBSee also:\fP .RS 4 \fBmass()\fP .RE .PP .PP Reimplemented in \fBQwtWheel\fP. .SS "void QwtAbstractSlider::setOrientation (Qt::Orientationo)\fC [virtual]\fP" .PP Set the orientation. \fBParameters:\fP .RS 4 \fIo\fP Orientation. Allowed values are Qt::Horizontal and Qt::Vertical. .RE .PP .PP Reimplemented in \fBQwtSlider\fP, and \fBQwtWheel\fP. .SS "void QwtDoubleRange::setPeriodic (booltf)\fC [inherited]\fP" .PP Make the range periodic. When the range is periodic, the value will be set to a point inside the interval such that .PP .PP .nf point = value + n * width .fi .PP .PP if the user tries to set a new value which is outside the range. If the range is nonperiodic (the default), values outside the range will be clipped. .PP \fBParameters:\fP .RS 4 \fItf\fP true for a periodic range .RE .PP .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. .SS "void QwtDoubleRange::setRange (doublevmin, doublevmax, doublevstep = \fC0.0\fP, intpageSize = \fC1\fP)\fC [inherited]\fP" .PP Specify range and step size. \fBParameters:\fP .RS 4 \fIvmin\fP lower boundary of the interval .br \fIvmax\fP higher boundary of the interval .br \fIvstep\fP step width .br \fIpageSize\fP page size in steps .RE .PP \fBWarning:\fP .RS 4 .PD 0 .IP "\(bu" 2 A change of the range changes the value if it lies outside the new range. The current value will *not* be adjusted to the new step raster. .IP "\(bu" 2 vmax < vmin is allowed. .IP "\(bu" 2 If the step size is left out or set to zero, it will be set to 1/100 of the interval length. .IP "\(bu" 2 If the step size has an absurd value, it will be corrected to a better one. .PP .RE .PP .SS "void QwtAbstractSlider::setReadOnly (boolreadOnly)\fC [virtual, slot]\fP"En/Disable read only mode .PP In read only mode the slider can't be controlled by mouse or keyboard. .PP \fBParameters:\fP .RS 4 \fIreadOnly\fP Enables in case of true .RE .PP \fBSee also:\fP .RS 4 \fBisReadOnly()\fP .RE .PP .SS "void QwtDoubleRange::setStep (doublevstep)\fC [inherited]\fP" .PP Change the step raster. \fBParameters:\fP .RS 4 \fIvstep\fP new step width .RE .PP \fBWarning:\fP .RS 4 The value will \fInot\fP be adjusted to the new step raster. .RE .PP .PP Reimplemented in \fBQwtCounter\fP. .SS "void QwtAbstractSlider::setTracking (boolenable)" .PP 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: .PD 0 .IP "\(bu" 2 the user releases the mouse button and the value has changed or .IP "\(bu" 2 at the end of automatic scrolling. .PP Tracking is enabled by default. .PP \fBParameters:\fP .RS 4 \fIenable\fP \fCtrue\fP (enable) or \fCfalse\fP (disable) tracking. .RE .PP .SS "void QwtAbstractSlider::setUpdateTime (intt)" .PP Specify the update interval for automatic scrolling. \fBParameters:\fP .RS 4 \fIt\fP update interval in milliseconds .RE .PP \fBSee also:\fP .RS 4 \fBgetScrollMode()\fP .RE .PP .SS "void QwtAbstractSlider::setValid (boolvalid)\fC [inline]\fP"\fBParameters:\fP .RS 4 \fIvalid\fP true/false .RE .PP \fBSee also:\fP .RS 4 QwtDblRange::isValid() .RE .PP .PP Reimplemented from \fBQwtDoubleRange\fP. .SS "void QwtAbstractSlider::setValue (doubleval)\fC [virtual, slot]\fP" .PP 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. .PP \fBParameters:\fP .RS 4 \fIval\fP new value .RE .PP \fBSee also:\fP .RS 4 \fBfitValue()\fP .RE .PP .PP Reimplemented from \fBQwtDoubleRange\fP. .SS "void QwtAbstractSlider::sliderMoved (doublevalue)\fC [signal]\fP"This signal is emitted when the user moves the slider with the mouse. .PP \fBParameters:\fP .RS 4 \fIvalue\fP new value .RE .PP .SS "void QwtAbstractSlider::sliderPressed ()\fC [signal]\fP"This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode). .SS "void QwtAbstractSlider::sliderReleased ()\fC [signal]\fP"This signal is emitted when the user releases the movable part of the slider. .SS "double QwtDoubleRange::step () const\fC [inherited]\fP"\fBReturns:\fP .RS 4 the step size .RE .PP \fBSee also:\fP .RS 4 \fBsetStep()\fP, \fBsetRange()\fP .RE .PP .PP Reimplemented in \fBQwtCounter\fP. .SS "void QwtDoubleRange::stepChange ()\fC [protected, virtual, inherited]\fP" .PP Notify a change of the step size. This virtual function is called whenever the step size changes. The default implementation does nothing. .SS "void QwtAbstractSlider::stopMoving ()" .PP Stop updating if automatic scrolling is active. .SS "void QwtAbstractSlider::timerEvent (QTimerEvent *e)\fC [protected, virtual]\fP"Qt timer event .PP \fBParameters:\fP .RS 4 \fIe\fP Timer event .RE .PP .SS "double QwtDoubleRange::value () const\fC [inherited]\fP" .PP Returns the current value. .PP Reimplemented in \fBQwtCounter\fP. .SS "void QwtAbstractSlider::valueChange ()\fC [protected, virtual]\fP"Notify change of value .PP 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. .PP Reimplemented from \fBQwtDoubleRange\fP. .PP Reimplemented in \fBQwtDial\fP, \fBQwtSlider\fP, and \fBQwtWheel\fP. .SS "void QwtAbstractSlider::valueChanged (doublevalue)\fC [signal]\fP" .PP Notify a change of value. In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see \fBsetTracking()\fP ). .PP \fBParameters:\fP .RS 4 \fIvalue\fP new value .RE .PP .SS "void QwtAbstractSlider::wheelEvent (QWheelEvent *e)\fC [protected, virtual]\fP"Wheel Event handler .PP \fBParameters:\fP .RS 4 \fIe\fP Whell event .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Qwt User's Guide from the source code.