QwtAbstractSlider(3) | Qwt User's Guide | QwtAbstractSlider(3) |
NAME¶
QwtAbstractSlider -An abstract base class for slider widgets with a scale.
SYNOPSIS¶
#include <qwt_abstract_slider.h>
Inherits QwtAbstractScale.
Inherited by QwtDial, QwtKnob, and QwtSlider.
Public Slots¶
void setValue (double val)
Signals¶
void valueChanged (double value)
Notify a change of value. void sliderPressed ()
void sliderReleased ()
void sliderMoved (double value)
Public Member Functions¶
QwtAbstractSlider (QWidget *parent=NULL)
Constructor. virtual ~QwtAbstractSlider ()
Destructor. void setValid (bool)
bool isValid () const
double value () const
Returns the current value. void setWrapping (bool)
bool wrapping () const
void setTotalSteps (uint)
Set the number of steps. uint totalSteps () const
void setSingleSteps (uint)
Set the number of steps for a single increment. uint singleSteps () const
void setPageSteps (uint)
Set the number of steps for a page increment. uint pageSteps () const
void setStepAlignment (bool)
Enable step alignment. bool stepAlignment () const
void setTracking (bool)
Enables or disables tracking. bool isTracking () const
void setReadOnly (bool)
bool isReadOnly () const
void setInvertedControls (bool)
bool invertedControls () const
Protected Member Functions¶
virtual void mousePressEvent (QMouseEvent *)
virtual void mouseReleaseEvent (QMouseEvent *)
virtual void mouseMoveEvent (QMouseEvent *)
virtual void keyPressEvent (QKeyEvent *)
virtual void wheelEvent (QWheelEvent *)
virtual bool isScrollPosition (const QPoint &pos) const =0
Determine what to do when the user presses a mouse button. virtual double scrolledTo (const QPoint &pos) const =0
Determine the value for a new position of the movable part of the slider. void incrementValue (int numSteps)
virtual void scaleChange ()
virtual void sliderChange ()
Calling update() double incrementedValue (double value, int stepCount) const
Detailed Description¶
An abstract base class for slider widgets with a scale.A slider widget displays a value according to a scale. The class is designed as a common super class for widgets like QwtKnob, QwtDial and QwtSlider.
When the slider is nor readOnly() its value can be modified by keyboard, mouse and wheel inputs.
The range of the slider is divided into a number of steps from which the value increments according to user inputs depend. Only for linear scales the number of steps correspond with a fixed step size.
Constructor & Destructor Documentation¶
QwtAbstractSlider::QwtAbstractSlider (QWidget *parent = NULL) [explicit]¶
Constructor. The scale is initialized to [0.0, 100.0], the number of steps is set to 100 with 1 and 10 and single an page step sizes. Step alignment is enabled.The initial value is invalid.
Parameters:
Member Function Documentation¶
double QwtAbstractSlider::incrementedValue (doublevalue, intstepCount) const [protected]¶
Increment a valueParameters:
stepCount Number of steps
Returns:
void QwtAbstractSlider::incrementValue (intstepCount) [protected]¶
Increment the sliderThe step size depends on the number of totalSteps()
Parameters:
See Also:
bool QwtAbstractSlider::invertedControls () const¶
Returns:See Also:
bool QwtAbstractSlider::isReadOnly () const¶
In read only mode the slider can't be controlled by mouse or keyboard.Returns:
See Also:
virtual bool QwtAbstractSlider::isScrollPosition (const QPoint &pos) const [protected], [pure virtual]¶
Determine what to do when the user presses a mouse button.Parameters:
Return values:
See Also:
Implemented in QwtKnob, QwtDial, and QwtSlider.
bool QwtAbstractSlider::isTracking () const¶
Returns:See Also:
bool QwtAbstractSlider::isValid () const¶
Returns:void QwtAbstractSlider::keyPressEvent (QKeyEvent *event) [protected], [virtual]¶
Handles key eventsQwtAbstractSlider handles the following keys:
- Qt::Key_Left Add/Subtract singleSteps() in direction to lowerBound();
- Qt::Key_Right Add/Subtract singleSteps() in direction to upperBound();
- Qt::Key_Down Subtract singleSteps(), when invertedControls() is false
- Qt::Key_Up Add singleSteps(), when invertedControls() is false
- Qt::Key_PageDown Subtract pageSteps(), when invertedControls() is false
- Qt::Key_PageUp Add pageSteps(), when invertedControls() is false
- Qt::Key_Home Set the value to the minimum()
- Qt::Key_End Set the value to the maximum()
Parameters:
See Also:
Reimplemented in QwtCompass.
void QwtAbstractSlider::mouseMoveEvent (QMouseEvent *event) [protected], [virtual]¶
Mouse Move Event handlerParameters:
void QwtAbstractSlider::mousePressEvent (QMouseEvent *event) [protected], [virtual]¶
Mouse press event handlerParameters:
Reimplemented in QwtSlider.
void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent *event) [protected], [virtual]¶
Mouse Release Event handlerParameters:
Reimplemented in QwtSlider.
uint QwtAbstractSlider::pageSteps () const¶
Returns:See Also:
void QwtAbstractSlider::scaleChange () [protected], [virtual]¶
Update the slider according to modifications of the scaleReimplemented from QwtAbstractScale.
Reimplemented in QwtDial, and QwtSlider.
virtual double QwtAbstractSlider::scrolledTo (const QPoint &pos) const [protected], [pure virtual]¶
Determine the value for a new position of the movable part of the slider.Parameters:
Returns:
See Also:
Implemented in QwtKnob, QwtDial, and QwtSlider.
void QwtAbstractSlider::setInvertedControls (boolon)¶
Invert wheel and key eventsUsually scrolling the mouse wheel 'up' and using keys like page up will increase the slider's value towards its maximum. When invertedControls() is enabled the value is scrolled towards its minimum.
Inverting the controls might be f.e. useful for a vertical slider with an inverted scale ( decreasing from top to bottom ).
Parameters:
See Also:
void QwtAbstractSlider::setPageSteps (uintstepCount)¶
Set the number of steps for a page increment. The range of the slider is divided into a number of steps from which the value increments according to user inputs depend.Parameters:
See Also:
void QwtAbstractSlider::setReadOnly (boolon)¶
En/Disable read only modeIn read only mode the slider can't be controlled by mouse or keyboard.
Parameters:
See Also:
Warning:
void QwtAbstractSlider::setSingleSteps (uintstepCount)¶
Set the number of steps for a single increment. The range of the slider is divided into a number of steps from which the value increments according to user inputs depend.Parameters:
See Also:
void QwtAbstractSlider::setStepAlignment (boolon)¶
Enable step alignment. When step alignment is enabled values resulting from slider movements are aligned to the step size.Parameters:
See Also:
void QwtAbstractSlider::setTotalSteps (uintstepCount)¶
Set the number of steps. The range of the slider is divided into a number of steps from which the value increments according to user inputs depend.The default setting is 100.
Parameters:
See Also:
void QwtAbstractSlider::setTracking (boolon)¶
Enables or disables tracking. If tracking is enabled, the slider emits the valueChanged() signal while the movable part of the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.Tracking is enabled by default.
Parameters:
See Also:
void QwtAbstractSlider::setValid (boolon)¶
Set the value to be valid/invalidParameters:
See Also:
void QwtAbstractSlider::setValue (doublevalue) [slot]¶
Set the slider to the specified valueParameters:
See Also:
void QwtAbstractSlider::setWrapping (boolon)¶
If wrapping is true stepping up from upperBound() value will take you to the minimum() value and vice versa.Parameters:
See Also:
uint QwtAbstractSlider::singleSteps () const¶
Returns:See Also:
void QwtAbstractSlider::sliderMoved (doublevalue) [signal]¶
This signal is emitted when the user moves the slider with the mouse.Parameters:
See Also:
void QwtAbstractSlider::sliderPressed () [signal]¶
This signal is emitted when the user presses the movable part of the slider.void QwtAbstractSlider::sliderReleased () [signal]¶
This signal is emitted when the user releases the movable part of the slider.bool QwtAbstractSlider::stepAlignment () const¶
Returns:See Also:
uint QwtAbstractSlider::totalSteps () const¶
Returns:See Also:
void QwtAbstractSlider::valueChanged (doublevalue) [signal]¶
Notify a change of value. When tracking is enabled (default setting), this signal will be emitted every time the value changes.Parameters:
See Also:
void QwtAbstractSlider::wheelEvent (QWheelEvent *event) [protected], [virtual]¶
Wheel Event handlerIn/decreases the value by s number of steps. The direction depends on the invertedControls() property.
When the control or shift modifier is pressed the wheel delta ( divided by 120 ) is mapped to an increment according to pageSteps(). Otherwise it is mapped to singleSteps().
Parameters:
Reimplemented in QwtDial.
bool QwtAbstractSlider::wrapping () const¶
Returns:See Also:
Author¶
Generated automatically by Doxygen for Qwt User's Guide from the source code.Thu Dec 11 2014 | Version 6.1.2 |