QwtAbstractSlider(3)
okay bestie, come sit with me, we're reading the QwtAbstractSlider(3) page from the Qwt User's Guide and ngl it's one of the most important pages in the whole widget-verse π«Ά grab a boba, this is gonna be fun.
πΈ NAME πΈ
QwtAbstractSlider β it's the abstract base class for slider widgets β¨ (and yes, abstract means you don't instantiate it, you inherit from it, periodt).
β¨ SYNOPSIS β¨
#include <qwt_abstract_slider.h>
- Inherits
QwtDoubleRange. - Inherited by
QwtDial,QwtKnob,QwtSlider, andQwtWheel.
π Public Types
enum ScrollMode { ScrNone, ScrMouse, ScrTimer, ScrDirect, ScrPage }
π Public Slots
virtual void fitValue (double val)
virtual void incValue (int steps)
virtual void setReadOnly (bool)
virtual void setValue (double val)
π¦ Signals
void sliderMoved (double value)
void sliderPressed ()
void sliderReleased ()
void valueChanged (double value)
π Public Member Functions
QwtAbstractSlider (Qt::Orientation, QWidget *parent=NULL)
virtual ~QwtAbstractSlider ()
bool isReadOnly () const
bool isValid () const
virtual double mass () const
Qt::Orientation orientation () const
virtual void setMass (double val)
virtual void setOrientation (Qt::Orientation o)
void setTracking (bool enable)
void setUpdateTime (int t)
void setValid (bool valid)
void stopMoving ()
π₯ Protected Member Functions
virtual void getScrollMode (const QPoint &p, int &scrollMode, int
&direction)=0
virtual double getValue (const QPoint &p)=0
virtual void keyPressEvent (QKeyEvent *e)
virtual void mouseMoveEvent (QMouseEvent *e)
double mouseOffset () const
virtual void mousePressEvent (QMouseEvent *e)
virtual void mouseReleaseEvent (QMouseEvent *e)
int scrollMode () const
void setMouseOffset (double)
virtual void setPosition (const QPoint &)
virtual void timerEvent (QTimerEvent *e)
virtual void valueChange ()
virtual void wheelEvent (QWheelEvent *e)
π Detailed Description π
An abstract base class for slider widgets. main character energy, but make it inheritance.
QwtAbstractSlider 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 getValue() and getScrollMode() members, and should react to a valueChange(), which normally requires repainting. that's the whole deal, and honestly? iconic.
π§ Member Enumeration Documentation π§
enum QwtAbstractSlider::ScrollMode
Scroll mode π
See also:
getScrollMode()
π Constructor & Destructor Documentation π
QwtAbstractSlider::QwtAbstractSlider (Qt::Orientationorientation, QWidget *parent = NULL) [explicit]
Constructor. Parameters:
- orientation β Orientation
- parent β Parent widget
π Member Function Documentation π
void QwtAbstractSlider::fitValue (doublevalue) [virtual], [slot]
Set the slider's value to the nearest integer multiple of the step size. snap snap snap π
Parameters:
- value β Value
See also:
setValue(),incValue()
Reimplemented from QwtDoubleRange.
virtual void QwtAbstractSlider::getScrollMode (const QPoint &p, int &scrollMode, int &direction) [protected], [pure virtual]
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. QwtAbstractSlider knows the following modes:
QwtAbstractSlider::ScrNoneβ Scrolling switched off. Don't change the value.QwtAbstractSlider::ScrMouseβ Change the value while the user keeps the button pressed and moves the mouse.QwtAbstractSlider::ScrTimerβ Automatic scrolling. Increment the value in the specified direction as long as the user keeps the button pressed.QwtAbstractSlider::ScrPageβ Automatic scrolling. Same asScrTimer, but increment by page size.
Parameters:
- p β point where the mouse was pressed
Return values:
- scrollMode β The scrolling mode
- direction β direction: 1, 0, or -1.
Implemented in QwtDial, QwtSlider, and QwtWheel.
virtual double QwtAbstractSlider::getValue (const QPoint &p) [protected], [pure virtual]
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. you're the one who knows what that point means, bestie, not this class
Parameters:
- p β point
Implemented in QwtDial, QwtSlider, and QwtWheel.
void QwtAbstractSlider::incValue (intsteps) [virtual], [slot]
Increment the value by a specified number of steps. Parameters:
- steps β number of steps
See also:
setValue()
Reimplemented from QwtDoubleRange.
bool QwtAbstractSlider::isReadOnly () const
In read only mode the slider can't be controlled by mouse or keyboard. it's giving "look but don't touch"
Returns:
trueif read only
See also:
setReadOnly()
bool QwtAbstractSlider::isValid () const [inline]
See also:
QwtDblRange::isValid()
Reimplemented from QwtDoubleRange.
void QwtAbstractSlider::keyPressEvent (QKeyEvent *e) [protected], [virtual]
Handles key events β¨οΈ
Key_Down,KeyLeftβ Decrement by 1Key_Up,Key_Rightβ Increment by 1
Parameters:
- e β Key event
See also:
isReadOnly()
Reimplemented in QwtDial, and QwtCompass.
double QwtAbstractSlider::mass () const [virtual]
Returns:
- mass
See also:
setMass()
Reimplemented in QwtWheel.
void QwtAbstractSlider::mouseMoveEvent (QMouseEvent *e) [protected], [virtual]
Mouse Move Event handler π±οΈ
Parameters:
- e β Mouse event
void QwtAbstractSlider::mousePressEvent (QMouseEvent *e) [protected], [virtual]
Mouse press event handler
Parameters:
- e β Mouse event
void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent *e) [protected], [virtual]
Mouse Release Event handler
Parameters:
- e β Mouse event
Qt::Orientation QwtAbstractSlider::orientation () const
Returns:
- Orientation
See also:
setOrientation()
void QwtAbstractSlider::setMass (doubleval) [virtual]
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. physics? in MY slider widget? apparently yes and it's kinda hot
Derived widgets may overload this function to make it public.
Parameters:
- val β New mass in kg
See also:
mass()
Reimplemented in QwtWheel.
void QwtAbstractSlider::setOrientation (Qt::Orientationo) [virtual]
Set the orientation. Parameters:
- o β Orientation. Allowed values are
Qt::HorizontalandQt::Vertical.
Reimplemented in QwtSlider, and QwtWheel.
void QwtAbstractSlider::setPosition (const QPoint &p) [protected], [virtual]
Move the slider to a specified point, adjust the value and emit signals if necessary.
void QwtAbstractSlider::setReadOnly (boolreadOnly) [virtual], [slot]
En/Disable read only mode π
In read only mode the slider can't be controlled by mouse or keyboard.
Parameters:
- readOnly β Enables in case of
true
See also:
isReadOnly()
void QwtAbstractSlider::setTracking (boolenable)
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:
- the user releases the mouse button and the value has changed or
- at the end of automatic scrolling.
Tracking is enabled by default. Parameters:
- enable β
true(enable) orfalse(disable) tracking.
void QwtAbstractSlider::setUpdateTime (intt)
Specify the update interval for automatic scrolling. Parameters:
- t β update interval in milliseconds
See also:
getScrollMode()
void QwtAbstractSlider::setValid (boolvalid) [inline]
Parameters:
- valid β
true/false
See also:
QwtDblRange::isValid()
Reimplemented from QwtDoubleRange.
void QwtAbstractSlider::setValue (doubleval) [virtual], [slot]
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. no rounding, we're going freestyle
Parameters:
- val β new value
See also:
fitValue()
Reimplemented from QwtDoubleRange.
void QwtAbstractSlider::sliderMoved (doublevalue) [signal]
This signal is emitted when the user moves the slider with the mouse. π£
Parameters:
- value β new value
void QwtAbstractSlider::sliderPressed () [signal]
This signal is emitted when the user presses the movable part of the slider (start ScrMouse Mode).
void QwtAbstractSlider::sliderReleased () [signal]
This signal is emitted when the user releases the movable part of the slider.
void QwtAbstractSlider::timerEvent (QTimerEvent *e) [protected], [virtual]
Qt timer event β°
Parameters:
- e β Timer event
void QwtAbstractSlider::valueChange () [protected], [virtual]
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 QwtDoubleRange.
Reimplemented in QwtDial, QwtSlider, and QwtWheel.
void QwtAbstractSlider::valueChanged (doublevalue) [signal]
Notify a change of value. In the default setting (tracking enabled), this signal will be emitted every time the value changes ( see setTracking() ).
Parameters:
- value β new value
void QwtAbstractSlider::wheelEvent (QWheelEvent *e) [protected], [virtual]
Wheel Event handler π‘
Parameters:
- e β Whell event
π¦ Author π¦
Generated automatically by Doxygen for Qwt User's Guide from the source code.
okay that's the whole page, you ate that fr fr π no cap, every flag, signal, slot and enum survived the vibe check π
and that's a wrap on Version 5.2.3, dated Tue Nov 20 2012 β go forth and subclass responsibly, bestie π«Άβ¨
π¦ where this page comes from
- epel 9: qwt5-qt5-devel 5.2.3a-12.20210522gita2b11e3.el9 Β· LGPLv2+ with exceptions
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 43: qwt5-qt5-devel 5.2.3a-22.20210522gita2b11e3.fc43 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- fedora 44: qwt5-qt5-devel 5.2.3a-23.20210522gita2b11e3.fc44 Β· LGPL-2.1-or-later WITH Qwt-exception-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms