QwtAbstractSlider(3)
๐ QwtAbstractSlider โ the QwtAbstractSlider(3) manual, bestie edition ๐
okay so this is the Library Functions Manual page for QwtAbstractSlider(3), and it is literally giving โabstract base class for slider widgets with a scaleโ โจ. This is the part-1 chunk, so we are keeping the whole vibe intact.
๐ธ 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 value)โ sets the value, bestie ๐
๐ฃ 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 () constdouble value () constโ Returns the current value.void setWrapping (bool)bool wrapping () constvoid setTotalSteps (uint)โ Set the number of steps.uint totalSteps () constvoid setSingleSteps (uint)โ Set the number of steps for a single increment.uint singleSteps () constvoid setPageSteps (uint)โ Set the number of steps for a page increment.uint pageSteps () constvoid setStepAlignment (bool)โ Enable step alignment.bool stepAlignment () constvoid setTracking (bool)โ Enables or disables tracking.bool isTracking () constvoid setReadOnly (bool)bool isReadOnly () constvoid setInvertedControls (bool)bool invertedControls () const
๐งฌ Public Member Functions inherited from QwtAbstractScale
QwtAbstractScale (QWidget *parent=NULL)virtual ~QwtAbstractScale ()โ Destructor.void setScale (double lowerBound, double upperBound)โ Specify a scale.void setScale (const QwtInterval &)โ Specify a scale.void setScale (const QwtScaleDiv &)โ Specify a scale.const QwtScaleDiv & scaleDiv () constvoid setLowerBound (double value)double lowerBound () constvoid setUpperBound (double value)double upperBound () constvoid setScaleStepSize (double stepSize)โ Set the step size used for calculating a scale division.double scaleStepSize () constvoid setScaleMaxMajor (int ticks)โ Set the maximum number of major tick intervals.int scaleMaxMinor () constvoid setScaleMaxMinor (int ticks)โ Set the maximum number of minor tick intervals.int scaleMaxMajor () constvoid setScaleEngine (QwtScaleEngine *)โ Set a scale engine.const QwtScaleEngine * scaleEngine () constQwtScaleEngine * scaleEngine ()int transform (double) constdouble invTransform (int) constbool isInverted () constdouble minimum () constdouble maximum () constconst QwtScaleMap & scaleMap () const
๐ก๏ธ Protected Member Functions
virtual void mousePressEvent (QMouseEvent *) overridevirtual void mouseReleaseEvent (QMouseEvent *) overridevirtual void mouseMoveEvent (QMouseEvent *) overridevirtual void keyPressEvent (QKeyEvent *) overridevirtual void wheelEvent (QWheelEvent *) overridevirtual 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 stepCount)virtual void scaleChange () overridevirtual void sliderChange ()โ Callingupdate().double incrementedValue (double value, int stepCount) const
๐ Protected Member Functions inherited from QwtAbstractScale
virtual void changeEvent (QEvent *) overridevoid rescale (double lowerBound, double upperBound, double stepSize)void setAbstractScaleDraw (QwtAbstractScaleDraw *)โ Set a scale draw.const QwtAbstractScaleDraw * abstractScaleDraw () constQwtAbstractScaleDraw * abstractScaleDraw ()void updateScaleDraw ()
๐ฅ 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 not readOnly() โ the page literally says โnor readOnly()โ ๐ญ, but you know what it means โ 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.
Definition at line 32 of file qwt_abstract_slider.h.
๐ 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 (yes, that is the original wording ๐ญ โ single and page step sizes, slay). Step alignment is enabled.
The initial value is invalid.
Parameters
- parent โ Parent widget
Definition at line 91 of file qwt_abstract_slider.cpp.
QwtAbstractSlider::~QwtAbstractSlider () [virtual]
Destructor.
Definition at line 101 of file qwt_abstract_slider.cpp.
double QwtAbstractSlider::incrementedValue (double value, int stepCount) const ๐งฎ [protected]
Okay so this one does the actual math of bumping a value up ๐
Give it a value and a stepCount and it hands back the incremented value.
valueโ the value you're starting fromstepCountโ how many steps you wanna move
Returns the incremented value, bestie. That's it, that's the function.
Defined at line 670 of qwt_abstract_slider.cpp โจ
void QwtAbstractSlider::incrementValue (int stepCount) [protected] ๐ผ
Increments the slider, no cap. The step size depends on totalSteps() โ so it's not just "add 1", it's scale-aware.
stepCountโ number of steps
PeepsetTotalSteps()andincrementedValue()if you want the lore ๐
Defined at line 650 of qwt_abstract_slider.cpp ๐
bool QwtAbstractSlider::invertedControls () const ๐
Returns True when the controls are inverted, fr.
Related tea: setInvertedControls()
Defined at line 637 of qwt_abstract_slider.cpp โจ
bool QwtAbstractSlider::isReadOnly () const ๐
Read-only mode means the slider can't be controlled by mouse or keyboard โ it's just there, existing, being pretty. Returns true if it's read only.
See also setReadOnly()
Defined at line 159 of qwt_abstract_slider.cpp ๐
virtual bool QwtAbstractSlider::isScrollPosition (const QPoint & pos) const [protected], [pure virtual] ๐ฑ๏ธ
This is the "what do we do when the user presses a mouse button" question, and honestly? It's giving main character energy because every subclass has to answer it themselves.
posโ mouse position
Return values: True when pos is a valid scroll position.
See also scrolledTo()
Implemented in QwtDial, QwtKnob, and QwtSlider ๐
bool QwtAbstractSlider::isTracking () const ๐ฏ
Returns True when tracking has been enabled.
See also setTracking()
Defined at line 186 of qwt_abstract_slider.cpp โจ
bool QwtAbstractSlider::isValid () const โ
Returns True when the value is invalid. Yes, that's what it says โ clock the irony, it's iconic ๐ญ
Defined at line 125 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::keyPressEvent (QKeyEvent * event) [override], [protected], [virtual] โจ๏ธ
Handles key events ๐ Here's the full keyboard lore, no cap:
Qt::Key_Leftโ add/subtractsingleSteps()in direction tolowerBound();Qt::Key_Rightโ add/subtractsingleSteps()in direction toupperBound();Qt::Key_Downโ subtractsingleSteps(), wheninvertedControls()isfalseQt::Key_Upโ addsingleSteps(), wheninvertedControls()isfalseQt::Key_PageDownโ subtractpageSteps(), wheninvertedControls()isfalseQt::Key_PageUpโ addpageSteps(), wheninvertedControls()isfalseQt::Key_Homeโ set the value to theminimum()Qt::Key_Endโ set the value to themaximum()eventโ the key event
See also isReadOnly()
Reimplemented in QwtCompass.
Defined at line 370 of qwt_abstract_slider.cpp ๐ฆ
void QwtAbstractSlider::mouseMoveEvent (QMouseEvent * event) [override], [protected], [virtual] ๐ฑ๏ธ
Mouse Move Event handler โ it's literally in the name bestie.
eventโ mouse event
Defined at line 220 of qwt_abstract_slider.cpp โจ
void QwtAbstractSlider::mousePressEvent (QMouseEvent * event) [override], [protected], [virtual] ๐
Mouse press event handler.
eventโ mouse event
Reimplemented in QwtSlider.
Defined at line 195 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::mouseReleaseEvent (QMouseEvent * event) [override], [protected], [virtual] โ
Mouse Release Event handler โ the "okay I'm done dragging" moment.
eventโ mouse event
Reimplemented in QwtSlider.
Defined at line 265 of qwt_abstract_slider.cpp ๐
uint QwtAbstractSlider::pageSteps () const ๐
Returns the number of steps. That's the whole vibe.
See alsosetPageSteps(),totalSteps(),singleSteps()
Defined at line 533 of qwt_abstract_slider.cpp โจ
void QwtAbstractSlider::scaleChange () [override], [protected], [virtual] ๐
Updates the slider according to modifications of the scale โ so when the scale shifts, the slider keeps up. Slay.
Reimplemented from QwtAbstractScale.
Reimplemented in QwtDial, and QwtSlider.
Defined at line 811 of qwt_abstract_slider.cpp ๐ธ
virtual double QwtAbstractSlider::scrolledTo (const QPoint & pos) const [protected], [pure virtual] ๐งญ
Figure out the value for a new position of the movable part of the slider. Pure virtual, so the subclasses do the actual work ๐
posโ mouse position
Returns the value for the mouse position.
See also isScrollPosition()
Implemented in QwtDial, QwtKnob, and QwtSlider.
void QwtAbstractSlider::setInvertedControls (bool on) ๐
Inverts wheel and key events.
So normally, scrolling the mouse wheel "up" and using keys like page up will increase the slider's value towards its maximum. But when invertedControls() is enabled, the value is scrolled towards its minimum instead. Flip it and reverse it ๐
Inverting the controls might be useful f.e. for a vertical slider with an inverted scale (decreasing from top to bottom).
onโ invert controls, whentrue
See alsoinvertedControls(),keyEvent(),wheelEvent()
Defined at line 628 of qwt_abstract_slider.cpp โญ
void QwtAbstractSlider::setPageSteps (uint stepCount) ๐
Sets the number of steps for a page increment. The range of the slider is divided into a number of steps, and how much the value increments on user input depends on that.
stepCountโ number of steps
See alsopageSteps(),setTotalSteps(),setSingleSteps()
Defined at line 524 of qwt_abstract_slider.cpp โจ
void QwtAbstractSlider::setReadOnly (bool on) ๐
Enables/disables read only mode. In read only mode the slider can't be controlled by mouse or keyboard โ it's giving decorative, honestly.
onโ enables in case oftrue
See also isReadOnly()
Warning โ ๏ธ The focus policy is set toQt::StrongFocusorQt::NoFocusโ not a vibe check, an actual side effect, so don't say I didn't warn you ๐
Defined at line 141 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::setSingleSteps (uint stepCount) 1๏ธโฃ
Sets the number of steps for a single increment. The range of the slider is divided into a number of steps, and the value increments according to user inputs depend on it.
stepCountโ number of steps
See alsosingleSteps(),setTotalSteps(),setPageSteps()
Defined at line 499 of qwt_abstract_slider.cpp ๐ฆ
void QwtAbstractSlider::setStepAlignment (bool on) ๐
Enables step alignment. When step alignment is enabled, values resulting from slider movements are aligned to the step size. It's giving tidy โจ
onโ enable step alignment whentrue
See also stepAlignment()
Defined at line 547 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::setTotalSteps (uint stepCount) ๐ข
Sets the number of steps. The range of the slider is divided into a number of steps, and the value increments according to user inputs depend on that.
The default setting is 100 โ note it, bestie, it's the factory setting ๐
stepCountโ number of steps
See alsototalSteps(),setSingleSteps(),setPageSteps()
Defined at line 474 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::setTracking (bool on) ๐
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 ๐
onโtrue(enable) orfalse(disable) tracking.
See alsoisTracking(),sliderMoved()
Defined at line 177 of qwt_abstract_slider.cpp โญ
void QwtAbstractSlider::setValid (bool on) โ
Sets the value to be valid/invalid.
onโ whentrue, the value is invalidated
See also setValue()
Defined at line 113 of qwt_abstract_slider.cpp ๐ธ
void QwtAbstractSlider::setValue (double value) [slot] โจ
Sets the slider to the specified value. The classic.
valueโ new value
See alsosetValid(),sliderChange(),valueChanged()
Defined at line 570 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::setWrapping (bool on) ๐
If wrapping is true, stepping up from the upperBound() value will take you to the minimum() value, and vice versa. It's the circle of life, slider edition ๐
onโ en/disable wrapping
See also wrapping()
Defined at line 599 of qwt_abstract_slider.cpp ๐
uint QwtAbstractSlider::singleSteps () const 1๏ธโฃ
Returns the number of steps.
See alsosetSingleSteps(),totalSteps(),pageSteps()
Defined at line 508 of qwt_abstract_slider.cpp โจ
void QwtAbstractSlider::sliderChange () [protected], [virtual] ๐
Calling update(). Short king of a function, honestly ๐
Reimplemented in QwtDial.
Defined at line 829 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::sliderMoved (double value) [signal] ๐ก
This signal is emitted when the user moves the slider with the mouse.
valueโ new value
See also valueChanged()
void QwtAbstractSlider::sliderPressed () [signal] ๐
This signal is emitted when the user presses the movable part of the slider. Literally just that. Not me being obsessed with a press event ๐
void QwtAbstractSlider::sliderReleased () [signal] โ
This signal is emitted when the user releases the movable part of the slider. The dramatic conclusion ๐ฌ
bool QwtAbstractSlider::stepAlignment () const ๐
Returns True when step alignment is enabled.
See also setStepAlignment()
Defined at line 559 of qwt_abstract_slider.cpp ๐ฆ
uint QwtAbstractSlider::totalSteps () const ๐ข
Returns the number of steps.
See alsosetTotalSteps(),singleSteps(),pageSteps()
Defined at line 483 of qwt_abstract_slider.cpp โญ
double QwtAbstractSlider::value () const ๐
Returns the current value. That's the tweet.
Defined at line 587 of qwt_abstract_slider.cpp ๐
void QwtAbstractSlider::valueChanged (double value) [signal] ๐
Notifies a change of value. When tracking is enabled (the default setting), this signal will be emitted every time the value changes โ every single time, she's chatty and we love her for it.
valueโ new value
See alsosetTracking(),sliderMoved()
void QwtAbstractSlider::wheelEvent (QWheelEvent * event) [override], [protected], [virtual] ๐ก
Wheel Event handler โ scroll scroll scroll.
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.
Defined at line 296 of qwt_abstract_slider.cpp ๐
bool QwtAbstractSlider::wrapping () const ๐
Returns True when wrapping is set.
See also setWrapping()
Defined at line 608 of qwt_abstract_slider.cpp ๐
โจ AUTHOR โจ
Generated automatically by Doxygen for Qwt User's Guide from the source code. Doxygen said "I'll do it myself" and honestly? Respect ๐ซถ
And that's the whole page, bestie โ every member function accounted for, zero facts dropped, all vibes intact. This one's from the Qwt User's Guide, page QwtAbstractSlider(3), and it was auto-generated for you with love (and by Doxygen, technically) ๐๐โจ
๐ฆ where this page comes from
- alpine 3.24: qwt-doc 6.3.0-r0 ยท custom
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms