QwtSliderBase is a base class for slider widgets. QwtSliderBase handles the mouse events and updates the slider's value accordingly. Derived classes only have to implement the getValue() and getScrollMode() members, and should react to a valueChange(), which normally requires repainting.
Definition at line 30 of file qwt_sldbase.h.
Public Types | |
enum | ScrollMode { ScrNone, ScrMouse, ScrTimer, ScrDirect, ScrPage } |
Public Slots | |
virtual void | setValue (double val) |
virtual void | fitValue (double val) |
virtual void | incValue (int steps) |
virtual void | setReadOnly (bool) |
Signals | |
void | valueChanged (double value) |
void | sliderPressed () |
void | sliderReleased () |
void | sliderMoved (double value) |
Public Member Functions | |
QwtSliderBase (Qt::Orientation orientation, QWidget *parent=0, const char *name=0, Qt::WFlags flags=0) | |
virtual | ~QwtSliderBase () |
void | setUpdateTime (int t) |
void | stopMoving () |
void | setTracking (bool enable) |
virtual void | setMass (double val) |
virtual double | mass () const |
virtual void | setOrientation (Orientation o) |
Orientation | orientation () const |
bool | isReadOnly () const |
bool | isValid () const |
void | setValid (bool valid) |
Protected Member Functions | |
void | setPosition (const QPoint &p) |
virtual void | valueChange () |
virtual void | timerEvent (QTimerEvent *e) |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | keyPressEvent (QKeyEvent *e) |
virtual void | wheelEvent (QWheelEvent *e) |
virtual double | getValue (const QPoint &p)=0 |
virtual void | getScrollMode (const QPoint &p, int &scrollMode, int &direction)=0 |
Protected Attributes | |
int | d_scrollMode |
double | d_mouseOffset |
int | d_direction |
int | d_tracking |
|
Constructor. Definition at line 19 of file qwt_sldbase.cpp. References QwtDblRange::setRange(), and setValue(). |
|
Destructor. Definition at line 38 of file qwt_sldbase.cpp. |
|
Set the slider's value to the nearest integer multiple of the step size.
Reimplemented from QwtDblRange. Definition at line 519 of file qwt_sldbase.cpp. References QwtDblRange::fitValue(), and stopMoving(). |
|
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. QwtSliderBase knows the following modes:
Implemented in QwtDial, QwtSlider, and QwtWheel.
Referenced by mousePressEvent(), and wheelEvent(). |
|
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.
Implemented in QwtDial, QwtSlider, and QwtWheel.
Referenced by mousePressEvent(), and setPosition(). |
|
Increment the value by a specified number of steps.
Reimplemented from QwtDblRange. Definition at line 531 of file qwt_sldbase.cpp. References QwtDblRange::incValue(), and stopMoving(). |
|
In read only mode the slider canīt be controlled by mouse or keyboard.
Referenced by QwtDial::drawFocusIndicator(), keyPressEvent(), QwtDial::keyPressEvent(), QwtCompass::keyPressEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and wheelEvent(). |
|
Reimplemented from QwtDblRange. Definition at line 66 of file qwt_sldbase.h. References QwtDblRange::isValid(). Referenced by QwtDial::drawContents(), QwtKnob::drawKnob(), QwtAnalogClock::drawNeedle(), QwtCompass::drawScaleContents(), QwtSlider::drawSlider(), keyPressEvent(), QwtDial::keyPressEvent(), mouseMoveEvent(), mousePressEvent(), mouseReleaseEvent(), and wheelEvent(). |
|
Handles key events
Reimplemented in QwtCompass, and QwtDial. Definition at line 341 of file qwt_sldbase.cpp. References QwtDblRange::incValue(), isReadOnly(), isValid(), orientation(), QwtDblRange::prevValue(), sliderMoved(), and QwtDblRange::value(). |
|
Reimplemented in QwtWheel. Definition at line 492 of file qwt_sldbase.cpp. Referenced by QwtWheel::mass(). |
|
Mouse Move Event handler. Definition at line 274 of file qwt_sldbase.cpp. References QwtDblRange::exactPrevValue(), QwtDblRange::exactValue(), isReadOnly(), isValid(), QwtDblRange::prevValue(), setPosition(), sliderMoved(), and QwtDblRange::value(). |
|
Mouse press event handler. Definition at line 115 of file qwt_sldbase.cpp. References getScrollMode(), getValue(), isReadOnly(), isValid(), sliderPressed(), stopMoving(), and QwtDblRange::value(). |
|
Mouse Release Event handler. Definition at line 166 of file qwt_sldbase.cpp. References QwtDblRange::fitValue(), QwtDblRange::incPages(), isReadOnly(), isValid(), setPosition(), sliderReleased(), QwtDblRange::step(), stopMoving(), and QwtDblRange::value(). |
|
Referenced by QwtSlider::drawSlider(), QwtSlider::drawThumb(), QwtWheel::drawWheel(), QwtWheel::drawWheelBackground(), QwtSlider::getScrollMode(), QwtWheel::getValue(), QwtSlider::getValue(), keyPressEvent(), QwtSlider::layoutSlider(), QwtWheel::minimumSizeHint(), QwtSlider::minimumSizeHint(), QwtSlider::QwtSlider(), QwtWheel::setOrientation(), QwtWheel::sizePolicy(), QwtSlider::sizePolicy(), and QwtSlider::xyPosition(). |
|
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. Derived widgets may overload this function to make it public.
Reimplemented in QwtWheel. Definition at line 478 of file qwt_sldbase.cpp. Referenced by QwtWheel::setMass(). |
|
Set the orientation.
Referenced by QwtWheel::setOrientation(), and QwtSlider::setOrientation(). |
|
Move the slider to a specified point, adjust the value and emit signals if necessary. Definition at line 248 of file qwt_sldbase.cpp. References QwtDblRange::fitValue(), and getValue(). Referenced by mouseMoveEvent(), and mouseReleaseEvent(). |
|
En/Disable read only mode In read only mode the slider canīt be controlled by mouse or keyboard.
Referenced by QwtAnalogClock::QwtAnalogClock(). |
|
Enables or disables tracking. If tracking is enabled, the slider emits a valueChanged() signal whenever its value changes (the default behaviour). If tracking is disabled, the value changed() signal will only be emitted if:
|
|
Specify the update interval for automatic scrolling.
Referenced by QwtKnob::QwtKnob(), and QwtWheel::QwtWheel(). |
|
Reimplemented from QwtDblRange. Definition at line 71 of file qwt_sldbase.h. References QwtDblRange::setValid(). Referenced by QwtAnalogClock::setTime(). |
|
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.
Reimplemented from QwtDblRange. Definition at line 506 of file qwt_sldbase.cpp. References QwtDblRange::setValue(), and stopMoving(). Referenced by QwtDial::keyPressEvent(), QwtCompass::keyPressEvent(), QwtSliderBase(), and QwtAnalogClock::setTime(). |
|
This signal is emitted when the user moves the slider with the mouse.
Referenced by keyPressEvent(), QwtDial::keyPressEvent(), mouseMoveEvent(), and wheelEvent(). |
|
This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode). Referenced by mousePressEvent(). |
|
This signal is emitted when the user releases the movable part of the slider. Referenced by mouseReleaseEvent(). |
|
Stop updating if automatic scrolling is active. Definition at line 92 of file qwt_sldbase.cpp. Referenced by fitValue(), incValue(), mousePressEvent(), mouseReleaseEvent(), setValue(), and timerEvent(). |
|
Qt timer event. Definition at line 388 of file qwt_sldbase.cpp. References QwtDblRange::exactValue(), QwtDblRange::fitValue(), QwtDblRange::incPages(), QwtDblRange::step(), stopMoving(), and QwtDblRange::value(). |
|
Notify change of value 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 valueChanged() signal if tracking is enabled. Reimplemented from QwtDblRange.
Reimplemented in QwtDial, QwtSlider, and QwtWheel. Definition at line 455 of file qwt_sldbase.cpp. References QwtDblRange::value(), and valueChanged(). Referenced by QwtWheel::valueChange(), QwtSlider::valueChange(), and QwtDial::valueChange(). |
|
Notify a change of value. In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see setTracking() ).
Referenced by valueChange(). |
|
Qt wheel event. Definition at line 304 of file qwt_sldbase.cpp. References getScrollMode(), QwtDblRange::incPages(), isReadOnly(), isValid(), QwtDblRange::prevValue(), sliderMoved(), and QwtDblRange::value(). |