|
QWT API (English) 7.3.0
Qt Widget Library for Technical Applications - English API Documentation
|
An abstract base class for slider widgets with a scale. More...
#include <qwt_abstract_slider.h>
Classes | |
| class | PrivateData |
Public Slots | |
| void | setValue (double value) |
| Set the slider value (English only) | |
Signals | |
| void | valueChanged (double value) |
| Notify a change of value. | |
| void | sliderPressed () |
| Signal emitted when the user presses the movable part of the slider. | |
| void | sliderReleased () |
| Signal emitted when the user releases the movable part of the slider. | |
| void | sliderMoved (double value) |
| Signal emitted when the user moves the slider with the mouse. | |
Public Member Functions | |
| QwtAbstractSlider (QWidget *parent=nullptr) | |
| Constructor for QwtAbstractSlider (English only) | |
| ~QwtAbstractSlider () override | |
| Destructor for QwtAbstractSlider (English only) | |
| void | setValid (bool) |
| Set whether the slider is valid (English only) | |
| bool | isValid () const |
| Return whether the slider is valid (English only) | |
| double | value () const |
| Return the current value (English only) | |
| void | setWrapping (bool) |
| Set whether wrapping is enabled (English only) | |
| bool | wrapping () const |
| Return whether wrapping is enabled (English only) | |
| void | setTotalSteps (uint) |
| Set the total number of steps (English only) | |
| uint | totalSteps () const |
| Return the total number of steps (English only) | |
| void | setSingleSteps (uint) |
| Set the number of single steps (English only) | |
| uint | singleSteps () const |
| Return the number of single steps (English only) | |
| void | setPageSteps (uint) |
| Set the number of page steps (English only) | |
| uint | pageSteps () const |
| Return the number of page steps (English only) | |
| void | setStepAlignment (bool) |
| Set whether step alignment is enabled (English only) | |
| bool | stepAlignment () const |
| Return whether step alignment is enabled (English only) | |
| void | setTracking (bool) |
| Set whether tracking is enabled (English only) | |
| bool | isTracking () const |
| Return whether tracking is enabled (English only) | |
| void | setReadOnly (bool) |
| Set whether the slider is read-only (English only) | |
| bool | isReadOnly () const |
| Return whether the slider is read-only (English only) | |
| void | setInvertedControls (bool) |
| Set whether controls are inverted (English only) | |
| bool | invertedControls () const |
| Return whether controls are inverted (English only) | |
Public Member Functions inherited from QwtAbstractScale | |
| QwtAbstractScale (QWidget *parent=nullptr) | |
| Constructor for QwtAbstractScale. | |
| void | setScale (double lowerBound, double upperBound) |
| Specify a scale by interval bounds. | |
| void | setScale (const QwtInterval &) |
| Specify a scale by interval. | |
| void | setScale (const QwtScaleDiv &) |
| Specify a scale by scale division. | |
| const QwtScaleDiv & | scaleDiv () const |
| Return the scale division. | |
| void | setLowerBound (double value) |
| Set the lower bound of the scale. | |
| double | lowerBound () const |
| Return the lower bound of the scale. | |
| void | setUpperBound (double value) |
| Set the upper bound of the scale. | |
| double | upperBound () const |
| Return the upper bound of the scale. | |
| void | setScaleStepSize (double stepSize) |
| Set the step size used for calculating scale division. | |
| double | scaleStepSize () const |
| Return the step size hint. | |
| void | setScaleMaxMajor (int ticks) |
| Set the maximum number of major tick intervals. | |
| int | scaleMaxMinor () const |
| Return the maximum number of minor tick intervals. | |
| void | setScaleMaxMinor (int ticks) |
| Set the maximum number of minor tick intervals. | |
| int | scaleMaxMajor () const |
| Return the maximum number of major tick intervals. | |
| void | setScaleEngine (QwtScaleEngine *) |
| Set the scale engine. | |
| const QwtScaleEngine * | scaleEngine () const |
| Return the scale engine (const version) | |
| QwtScaleEngine * | scaleEngine () |
| Return the scale engine (non-const version) | |
| int | transform (double) const |
| Transform a scale value to widget coordinates. | |
| double | invTransform (int) const |
| Transform a widget coordinate to scale value. | |
| bool | isInverted () const |
| Check if scale is inverted. | |
| double | minimum () const |
| Return the minimum boundary. | |
| double | maximum () const |
| Return the maximum boundary. | |
| const QwtScaleMap & | scaleMap () const |
| Return the scale map. | |
Protected Member Functions | |
| virtual void | mousePressEvent (QMouseEvent *) override |
| Handle mouse press events (English only) | |
| virtual void | mouseReleaseEvent (QMouseEvent *) override |
| Handle mouse release events (English only) | |
| virtual void | mouseMoveEvent (QMouseEvent *) override |
| Handle mouse move events (English only) | |
| virtual void | keyPressEvent (QKeyEvent *) override |
| Handle key press events (English only) | |
| virtual void | wheelEvent (QWheelEvent *) override |
| Handle wheel events (English only) | |
| virtual bool | isScrollPosition (const QPoint &pos) const =0 |
| virtual double | scrolledTo (const QPoint &pos) const =0 |
| void | incrementValue (int stepCount) |
| Increment the value by a number of steps (English only) | |
| virtual void | scaleChange () override |
| Handle scale changes (English only) | |
| virtual void | sliderChange () |
| Handle slider changes (English only) | |
| double | incrementedValue (double value, int stepCount) const |
| Calculate incremented value (English only) | |
Protected Member Functions inherited from QwtAbstractScale | |
| virtual void | changeEvent (QEvent *) override |
| Handle change events (English only) | |
| void | rescale (double lowerBound, double upperBound, double stepSize) |
| Recalculate scale and update scale draw (English only) | |
| void | setAbstractScaleDraw (QwtAbstractScaleDraw *) |
| Set the scale draw object (English only) | |
| const QwtAbstractScaleDraw * | abstractScaleDraw () const |
| Return the scale draw (const version) (English only) | |
| QwtAbstractScaleDraw * | abstractScaleDraw () |
| Return the scale draw (non-const version) (English only) | |
| void | updateScaleDraw () |
| Update the scale draw (English only) | |
Properties | |
| double | value |
| uint | totalSteps |
| uint | singleSteps |
| uint | pageSteps |
| bool | stepAlignment |
| bool | readOnly |
| bool | tracking |
| bool | wrapping |
| bool | invertedControls |
Properties inherited from QwtAbstractScale | |
| double | lowerBound |
| double | upperBound |
| int | scaleMaxMajor |
| int | scaleMaxMinor |
| double | scaleStepSize |
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 not 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.
|
explicit |
Constructor for QwtAbstractSlider (English only)
Constructor for QwtAbstractSlider.
The scale is initialized to [0.0, 100.0], the number of steps is set to 100 with 1 and 10 as single and page step sizes. Step alignment is enabled. The initial value is invalid.
| parent | Parent widget |
Destructor for QwtAbstractSlider
|
protected |
Calculate incremented value (English only)
Increment a value.
| value | Value to increment |
| stepCount | Number of steps |
|
protected |
Increment the value by a number of steps (English only)
Increment the slider.
The step size depends on the number of totalSteps()
| stepCount | Number of steps |
| bool QwtAbstractSlider::invertedControls | ( | ) | const |
Return whether controls are inverted (English only)
Check if controls are inverted.
| bool QwtAbstractSlider::isReadOnly | ( | ) | const |
Return whether the slider is read-only (English only)
Check if read-only mode is enabled.
|
protectedpure virtual |
| bool QwtAbstractSlider::isTracking | ( | ) | const |
Return whether tracking is enabled (English only)
Check if tracking is enabled.
| bool QwtAbstractSlider::isValid | ( | ) | const |
Return whether the slider is valid (English only)
Check if the value is valid.
|
overrideprotectedvirtual |
Handle key press events (English only)
Handle key press events.
QwtAbstractSlider handles the following keys:
| event | Key event |
Reimplemented in QwtCompass.
|
overrideprotectedvirtual |
Handle mouse move events (English only)
Handle mouse move events.
| event | Mouse event |
Updates the slider value while scrolling.
|
overrideprotectedvirtual |
Handle mouse press events (English only)
Handle mouse press events.
| event | Mouse event |
Initiates scrolling if the position is valid.
Reimplemented in QwtSlider.
|
overrideprotectedvirtual |
Handle mouse release events (English only)
Handle mouse release events.
| event | Mouse event |
Ends scrolling and emits valueChanged() if needed.
Reimplemented in QwtSlider.
| uint QwtAbstractSlider::pageSteps | ( | ) | const |
Return the number of page steps (English only)
Return the number of page steps.
|
overrideprotectedvirtual |
Handle scale changes (English only)
Update the slider according to modifications of the scale.
Updates the current value to stay within the new scale range and emits valueChanged() if the value was adjusted.
Reimplemented from QwtAbstractScale.
|
protectedpure virtual |
| void QwtAbstractSlider::setInvertedControls | ( | bool | on | ) |
Set whether controls are inverted (English only)
Invert wheel and key events.
Usually 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).
| on | Invert controls when true |
| void QwtAbstractSlider::setPageSteps | ( | uint | stepCount | ) |
Set the number of page steps (English only)
Set the number of page steps.
The range of the slider is divided into a number of steps from which the value increments according to user inputs depend.
| [in] | stepCount | Number of steps |
| void QwtAbstractSlider::setReadOnly | ( | bool | on | ) |
Set whether the slider is read-only (English only)
Enable or disable read-only mode.
In read-only mode the slider can't be controlled by mouse or keyboard.
| on | Enables read-only mode if true |
| void QwtAbstractSlider::setSingleSteps | ( | uint | stepCount | ) |
Set the number of single steps (English only)
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.
| [in] | stepCount | Number of steps |
| void QwtAbstractSlider::setStepAlignment | ( | bool | on | ) |
Set whether step alignment is enabled (English only)
Enable step alignment.
When step alignment is enabled values resulting from slider movements are aligned to the step size.
| on | Enable step alignment when true |
| void QwtAbstractSlider::setTotalSteps | ( | uint | stepCount | ) |
Set the total number of steps (English only)
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.
| [in] | stepCount | Number of steps |
| void QwtAbstractSlider::setTracking | ( | bool | on | ) |
Set whether tracking is enabled (English only)
Enable or disable 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.
| on | True to enable tracking, false to disable |
| void QwtAbstractSlider::setValid | ( | bool | on | ) |
Set whether the slider is valid (English only)
Set the value to be valid or invalid.
| on | When true, the value is invalidated |
|
slot |
Set the slider value (English only)
Set the slider to the specified value.
| value | New value |
| void QwtAbstractSlider::setWrapping | ( | bool | on | ) |
Set whether wrapping is enabled (English only)
Enable or disable wrapping.
If wrapping is true stepping up from upperBound() value will take you to the minimum() value and vice versa.
| on | Enable wrapping when true |
| uint QwtAbstractSlider::singleSteps | ( | ) | const |
Return the number of single steps (English only)
Return the number of single steps.
|
protectedvirtual |
Handle slider changes (English only)
Handle slider changes.
Called when the slider needs to update its appearance. The default implementation calls update().
Reimplemented in QwtDial.
|
signal |
Signal emitted when the user moves the slider with the mouse.
| value | New value |
| bool QwtAbstractSlider::stepAlignment | ( | ) | const |
Return whether step alignment is enabled (English only)
Check if step alignment is enabled.
| uint QwtAbstractSlider::totalSteps | ( | ) | const |
Return the total number of steps (English only)
Return the number of steps.
| double QwtAbstractSlider::value | ( | ) | const |
Return the current value (English only)
Return the current value.
|
signal |
Notify a change of value.
When tracking is enabled (default setting), this signal will be emitted every time the value changes.
| value | New value |
|
overrideprotectedvirtual |
Handle wheel events (English only)
Handle wheel events.
In/decreases the value by a 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().
| event | Wheel event |
Reimplemented in QwtDial.
| bool QwtAbstractSlider::wrapping | ( | ) | const |
Return whether wrapping is enabled (English only)
Check if wrapping is enabled.