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 () 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

๐Ÿงฌ 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 () const
  • void setLowerBound (double value)
  • double lowerBound () const
  • void setUpperBound (double value)
  • double upperBound () const
  • void setScaleStepSize (double stepSize) โ€” Set the step size used for calculating a scale division.
  • double scaleStepSize () const
  • void setScaleMaxMajor (int ticks) โ€” Set the maximum number of major tick intervals.
  • int scaleMaxMinor () const
  • void setScaleMaxMinor (int ticks) โ€” Set the maximum number of minor tick intervals.
  • int scaleMaxMajor () const
  • void setScaleEngine (QwtScaleEngine *) โ€” Set a scale engine.
  • const QwtScaleEngine * scaleEngine () const
  • QwtScaleEngine * scaleEngine ()
  • int transform (double) const
  • double invTransform (int) const
  • bool isInverted () const
  • double minimum () const
  • double maximum () const
  • const QwtScaleMap & scaleMap () const

๐Ÿ›ก๏ธ Protected Member Functions

  • virtual void mousePressEvent (QMouseEvent *) override
  • virtual void mouseReleaseEvent (QMouseEvent *) override
  • virtual void mouseMoveEvent (QMouseEvent *) override
  • virtual void keyPressEvent (QKeyEvent *) override
  • virtual void wheelEvent (QWheelEvent *) override
  • 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 stepCount)
  • virtual void scaleChange () override
  • virtual void sliderChange () โ€” Calling update().
  • double incrementedValue (double value, int stepCount) const

๐Ÿ’œ Protected Member Functions inherited from QwtAbstractScale

  • virtual void changeEvent (QEvent *) override
  • void rescale (double lowerBound, double upperBound, double stepSize)
  • void setAbstractScaleDraw (QwtAbstractScaleDraw *) โ€” Set a scale draw.
  • const QwtAbstractScaleDraw * abstractScaleDraw () const
  • QwtAbstractScaleDraw * 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 from
  • stepCount โ€” 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
Peep setTotalSteps() and incrementedValue() 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/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()
  • 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 also setPageSteps(), 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, when true
See also invertedControls(), 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 also pageSteps(), 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 of true
See also isReadOnly()
Warning โš ๏ธ The focus policy is set to Qt::StrongFocus or Qt::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 also singleSteps(), 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 when true
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 also totalSteps(), 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) or false (disable) tracking.
See also isTracking(), sliderMoved()

Defined at line 177 of qwt_abstract_slider.cpp โญ


void QwtAbstractSlider::setValid (bool on) โœ…

Sets the value to be valid/invalid.

  • on โ€” when true, 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 also setValid(), 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 also setSingleSteps(), 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 also setTotalSteps(), 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 also setTracking(), 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