#include <qwt_sldbase.h>
Inherits QWidget, and QwtDblRange.
Inherited by QwtKnob, QwtSlider, and QwtWheel.
Inheritance diagram for QwtSliderBase
Public Types | |
enum | { ScrNone, ScrMouse, ScrTimer, ScrDirect, ScrPage } |
Public Methods | |
QwtSliderBase ( QWidget *parent = 0, const char *name = 0 ) | |
~QwtSliderBase () | |
void | setUpdateTime (int t) |
void | stopMoving () |
void | setTracking (bool enable) |
Public Slots | |
void | setValue (double val) |
void | fitValue (double val) |
void | incValue (int steps) |
Signals | |
void | valueChanged (double value) |
void | sliderPressed () |
void | sliderReleased () |
void | sliderMoved (double value) |
Protected Methods | |
virtual void | setMass (double val) |
void | setPosition (const QPoint &p) |
virtual void | valueChange () |
virtual double | mass () const |
void | timerEvent (QTimerEvent *e) |
void | mousePressEvent (QMouseEvent *e) |
void | mouseReleaseEvent (QMouseEvent *e) |
void | mouseMoveEvent (QMouseEvent *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 |
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.
|
Constructor.
|
|
Destructor.
|
|
Set the slider's value to the nearest integer multiple of the step size.
Reimplemented from QwtDblRange. |
|
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:
Reimplemented in QwtSlider. |
|
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.
Reimplemented in QwtSlider. |
|
Increment the value by a specified number of steps.
Reimplemented from QwtDblRange. |
|
Mouse Move Event handler.
|
|
Mouse press event handler.
|
|
Mouse Release Event handler.
|
|
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. |
|
Move the slider to a specified point, adjust the value and emit signals if necessary. |
|
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.
|
|
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. |
|
This signal is emitted when the user moves the slider with the mouse.
|
|
This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode). |
|
This signal is emitted when the user releases the movable part of the slider. |
|
Stop updating if automatic scrolling is active.
|
|
Timer event handler.
|
|
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 QwtSlider. |
|
Notify a change of value.
In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see setTracking() ).
|