QwtSlider(3)

πŸŽ€ QwtSlider(3) β€” The Slider Widget πŸŽ€

okay so bestie, this is QwtSlider(3) out of the Library Functions Manual, and it's honestly a whole vibe. It's a slider widget. A fancy slider widget. Let's get into it πŸ’…βœ¨


🌸 NAME 🌸

QwtSlider β€” the Slider Widget. that's it, that's the name, main character energy fr fr πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <qwt_slider.h>

It Inherits QwtAbstractSlider β€” so like, it's got the whole family tree going on, iykyk.


🌈 Public Types 🌈

enum ScalePosition { NoScale, LeadingScale, TrailingScale }

three positions, three moods, pick your fave ✨


πŸ’– Public Member Functions πŸ’–

okay this list is kinda long but every single one matters, no skipping, we're doing this properly 🫢

  • QwtSlider(QWidget *parent=NULL)
  • QwtSlider(Qt::Orientation, QWidget *parent=NULL)
  • virtual ~QwtSlider() β€” Destructor. bye bestie 😭
  • void setOrientation(Qt::Orientation) β€” Set the orientation. like, which way is it even going
  • Qt::Orientation orientation() const
  • void setScalePosition(ScalePosition) β€” Change the position of the scale.
  • ScalePosition scalePosition() const
  • void setTrough(bool)
  • bool hasTrough() const
  • void setGroove(bool)
  • bool hasGroove() const
  • void setHandleSize(const QSize &) β€” Set the slider's handle size. give the handle the size it deserves πŸ’…
  • QSize handleSize() const
  • void setBorderWidth(int) β€” Change the slider's border width.
  • int borderWidth() const
  • void setSpacing(int) β€” Change the spacing between trough and scale.
  • int spacing() const
  • virtual QSize sizeHint() const override
  • virtual QSize minimumSizeHint() const override
  • void setScaleDraw(QwtScaleDraw *) β€” Set a scale draw.
  • const QwtScaleDraw * scaleDraw() const
  • void setUpdateInterval(int) β€” Specify the update interval for automatic scrolling.
  • int updateInterval() const

🧚 Public Member Functions inherited from QwtAbstractSlider 🧚

the inherited era, we respect it πŸ’œ

  • 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 πŸ“

more inherited icons, we love a legacy ✨

  • 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 πŸ’€

the protected era β€” lowkey exclusive, but we're gonna show u anyway 🀫

  • virtual double scrolledTo(const QPoint &) const override β€” Determine the value for a new position of the slider handle.
  • virtual bool isScrollPosition(const QPoint &) const override β€” Determine what to do when the user presses a mouse button.
  • virtual void drawSlider(QPainter *, const QRect &) const
  • virtual void drawHandle(QPainter *, const QRect &, int pos) const
  • virtual void mousePressEvent(QMouseEvent *) override
  • virtual void mouseReleaseEvent(QMouseEvent *) override
  • virtual void resizeEvent(QResizeEvent *) override
  • virtual void paintEvent(QPaintEvent *) override
  • virtual void changeEvent(QEvent *) override
  • virtual void timerEvent(QTimerEvent *) override
  • virtual bool event(QEvent *) override
  • virtual void scaleChange() override β€” Notify changed scale.
  • QRect sliderRect() const
  • QRect handleRect() const

🌟 Protected Member Functions inherited from QwtAbstractSlider 🌟

  • virtual void mouseMoveEvent(QMouseEvent *) override
  • virtual void keyPressEvent(QKeyEvent *) override
  • virtual void wheelEvent(QWheelEvent *) override
  • void incrementValue(int stepCount)
  • virtual void sliderChange() β€” Calling update().
  • double incrementedValue(double value, int stepCount) const

πŸŽ€ Protected Member Functions inherited from QwtAbstractScale πŸŽ€

  • void rescale(double lowerBound, double upperBound, double stepSize)
  • void setAbstractScaleDraw(QwtAbstractScaleDraw *) β€” Set a scale draw.
  • const QwtAbstractScaleDraw * abstractScaleDraw() const
  • QwtAbstractScaleDraw * abstractScaleDraw()
  • void updateScaleDraw()

⭐ Additional Inherited Members ⭐

πŸ’… Public Slots inherited from QwtAbstractSlider πŸ’…

  • void setValue(double value)

πŸ”₯ Signals inherited from QwtAbstractSlider πŸ”₯

  • void valueChanged(double value) β€” Notify a change of value.
  • void sliderPressed()
  • void sliderReleased()
  • void sliderMoved(double value)

🌸 Detailed Description 🌸

The Slider Widget.

QwtSlider is a slider widget which operates on an interval of type double. Its position is related to a scale showing the current value. lowkey iconic how it just… knows where it is πŸ’«

The slider can be customized by having a through, a groove β€” or both. yes bestie, u can have both. we're not gatekeeping πŸ™Œ

Definition at line 30 of file qwt_slider.h. (iykyk, the receipts are right there πŸ“)

πŸ¦‹ Member Enumeration Documentation πŸ¦‹

enum QwtSlider::ScalePosition

Position of the scale. it's giving placement era πŸ’…

See also: QwtSlider(), setScalePosition(), setOrientation()

Enumerator

  • NoScale β€” The slider has no scale. minimalism, we respect it.
  • LeadingScale β€” The scale is right of a vertical slider, or below a horizontal slider.
  • TrailingScale β€” The scale is left of a vertical slider, or above a horizontal slider.
Definition at line 54 of file qwt_slider.h.

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

QwtSlider::QwtSlider(QWidget * parent = NULL) [explicit]

Constructs a vertical slider in QwtSlider::Trough style, with a scale to the left. the og setup fr fr.

The scale is initialized to [0.0, 100.0] and the value set to 0.0. clean slate, fresh start, we love to see it ✨

Parameters:

  • parent β€” Parent widget.

See also: setOrientation(), setScalePosition(), setBackgroundStyle()

Definition at line 119 of file qwt_slider.cpp.

QwtSlider::QwtSlider(Qt::Orientation orientation, QWidget * parent = NULL) [explicit]

Constructs a slider in QwtSlider::Trough style. ok so it's the same trough vibe, but now u get to pick the orientation πŸ‘‘

When orientation is Qt::Vertical the scale will be aligned to the left β€” otherwise it ends up at the top of the slider.

The scale is initialized to [0.0, 100.0] and the value set to 0.0. same fresh-start energy, no cap πŸ’–

Parameters:

  • parent β€” Parent widget.
  • orientation β€” Orientation of the slider.
Definition at line 136 of file qwt_slider.cpp.

QwtSlider::~QwtSlider() [virtual]

Destructor. it's the goodbye era πŸ˜­πŸ’”

Definition at line 143 of file qwt_slider.cpp.

πŸ’… MEMBER FUNCTION DOCUMENTATION πŸ’…

πŸŽ€ int QwtSlider::borderWidth () const πŸŽ€

Bestie, this one just hands you the border width. That's it. Iconic minimalism.

  • Returns β€” the border width.
  • See also: setBorderWidth()
  • Definition: Definition at line 262 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::changeEvent (QEvent * event) πŸŽ€

[override], [protected], [virtual]

This is the event handler that handles QEvent::StyleChange and QEvent::FontChange events. It's giving "I notice when the vibe shifts."

  • Parameters
    • event β€” Change event
  • Reimplemented from QwtAbstractScale.
  • Definition: Definition at line 724 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::drawHandle (QPainter * painter, const QRect & handleRect, int pos) const πŸŽ€

[protected], [virtual]

Draws the thumb at a position. Very "main character marker energy."

  • Parameters
    • painter β€” Painter
    • handleRect β€” Bounding rectangle of the handle
    • pos β€” Position of the handle marker in widget coordinates
  • Definition: Definition at line 473 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::drawSlider (QPainter * painter, const QRect & sliderRect) const πŸŽ€

[protected], [virtual]

Draws the slider into the specified rectangle. Slay, but rectangle-bound.

  • Parameters
    • painter β€” Painter
    • sliderRect β€” Bounding rectangle of the slider
  • Definition: Definition at line 415 of file qwt_slider.cpp.

πŸŽ€ bool QwtSlider::event (QEvent * event) πŸŽ€

[override], [protected], [virtual]

Qt event handler. It's the bouncer at the event club.

  • Parameters
    • event β€” Event
  • Returns β€” true, if event was recognized and processed
  • Definition: Definition at line 712 of file qwt_slider.cpp.

πŸŽ€ QRect QwtSlider::handleRect () const πŸŽ€

[protected]

Gives you the bounding rectangle of the slider handle. Lowkey useful for knowing where the handle is living.

  • Returns β€” Bounding rectangle of the slider handle
  • Definition: Definition at line 990 of file qwt_slider.cpp.

πŸŽ€ QSize QwtSlider::handleSize () const πŸŽ€

Returns the size of the handle. Not too big, not too small β€” just handle-sized.

  • Returns β€” Size of the handle.
  • See also: setHandleSize()
  • Definition: Definition at line 326 of file qwt_slider.cpp.

πŸŽ€ bool QwtSlider::hasGroove () const πŸŽ€

Returns True, when the groove is visible. Groove check: passed. πŸ’…

  • Returns β€” True, when the groove is visible
  • See also: setGroove(), hasTrough()
  • Definition: Definition at line 904 of file qwt_slider.cpp.

πŸŽ€ bool QwtSlider::hasTrough () const πŸŽ€

Returns True, when the trough is visible. Trough check: also passed.

  • Returns β€” True, when the trough is visible
  • See also: setTrough(), hasGroove()
  • Definition: Definition at line 875 of file qwt_slider.cpp.

πŸŽ€ bool QwtSlider::isScrollPosition (const QPoint & pos) const πŸŽ€

[override], [protected], [virtual]

Determines what to do when the user presses a mouse button. Basically: "is this mouse press on the handle, or are we somewhere else?"

  • Parameters
    • pos β€” Mouse position
  • Return values β€” True,when handleRect() contains pos
  • See also: scrolledTo()
  • Implements QwtAbstractSlider.
  • Definition: Definition at line 503 of file qwt_slider.cpp.

πŸŽ€ QSize QwtSlider::minimumSizeHint () const πŸŽ€

[override], [virtual]

Returns the minimum size hint. The "smallest acceptable version of me" vibe.

  • Returns β€” Minimum size hint
  • See also: sizeHint()
  • Definition: Definition at line 922 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::mousePressEvent (QMouseEvent * event) πŸŽ€

[override], [protected], [virtual]

Mouse press event handler. The moment the mouse goes click.

  • Parameters
    • event β€” Mouse event
  • Reimplemented from QwtAbstractSlider.
  • Definition: Definition at line 547 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::mouseReleaseEvent (QMouseEvent * event) πŸŽ€

[override], [protected], [virtual]

Mouse release event handler. The click's graceful exit.

  • Parameters
    • event β€” Mouse event
  • Reimplemented from QwtAbstractSlider.
  • Definition: Definition at line 606 of file qwt_slider.cpp.

πŸŽ€ Qt::Orientation QwtSlider::orientation () const πŸŽ€

Returns the orientation. Horizontal? Vertical? The slider knows its lane.

  • Returns β€” Orientation
  • See also: setOrientation()
  • Definition: Definition at line 202 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::paintEvent (QPaintEvent * event) πŸŽ€

[override], [protected], [virtual]

Qt paint event handler. Time to serve looks on screen.

  • Parameters
    • event β€” Paint event
  • Definition: Definition at line 675 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::resizeEvent (QResizeEvent * event) πŸŽ€

[override], [protected], [virtual]

Qt resize event handler. When the widget changes shape, this handles the glow-up.

  • Parameters
    • event β€” Resize event
  • Definition: Definition at line 700 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::scaleChange () πŸŽ€

[override], [protected], [virtual]

Notify changed scale. It's the "hey bestie, the scale changed" announcement.

  • Reimplemented from QwtAbstractSlider.
  • Definition: Definition at line 378 of file qwt_slider.cpp.

πŸŽ€ const QwtScaleDraw * QwtSlider::scaleDraw () const πŸŽ€

Returns the scale draw of the slider. The visual blueprint of the scale, basically.

  • Returns β€” the scale draw of the slider
  • See also: setScaleDraw()
  • Definition: Definition at line 363 of file qwt_slider.cpp.

πŸŽ€ QwtSlider::ScalePosition QwtSlider::scalePosition () const πŸŽ€

Returns the position of the scale. Where the scale is sitting, exactly.

  • Returns β€” Position of the scale
  • See also: setScalePosition()
  • Definition: Definition at line 230 of file qwt_slider.cpp.

πŸŽ€ double QwtSlider::scrolledTo (const QPoint & pos) const πŸŽ€

[override], [protected], [virtual]

Determines the value for a new position of the slider handle. Mouse moves, value follows. ✨

  • Parameters
    • pos β€” Mouse position
  • Returns β€” Value for the mouse position
  • See also: isScrollPosition()
  • Implements QwtAbstractSlider.
  • Definition: Definition at line 526 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setBorderWidth (int width) πŸŽ€

Changes the slider's border width. The border width is used for drawing the slider handle and the trough. It's the outfit's trim detail, honestly.

  • Parameters
    • width β€” Border width
  • See also: borderWidth()
  • Definition: Definition at line 244 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setGroove (bool on) πŸŽ€

En/Disable the groove. The slider can be customized by showing a groove for the handle. Groove on = little runway moment.

  • Parameters
    • on β€” When true, the groove is visible
  • See also: hasGroove(), setThrough()
  • Definition: Definition at line 889 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setHandleSize (const QSize & size) πŸŽ€

Set the slider's handle size. When the size is empty the slider handle will be painted with a default size depending on its orientation() and backgroundStyle().

  • Parameters
    • size β€” New size
  • See also: handleSize()
  • Definition: Definition at line 311 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setOrientation (Qt::Orientation orientation) πŸŽ€

Set the orientation. Allowed values are Qt::Horizontal and Qt::Vertical. Gotta pick a lane, bestie.

  • Parameters
    • orientation β€” Allowed values are Qt::Horizontal and Qt::Vertical.
  • See also: orientation(), scalePosition()
  • Definition: Definition at line 175 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setScaleDraw (QwtScaleDraw * scaleDraw) πŸŽ€

Set a scale draw. For changing the labels of the scales, it is necessary to derive from QwtScaleDraw and overload QwtScaleDraw::label().

  • Parameters
    • scaleDraw β€” ScaleDraw object, that has to be created with new and will be deleted in ~QwtSlider() or the next call of setScaleDraw().
  • See also: scaleDraw()
  • Definition: Definition at line 344 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setScalePosition (ScalePosition scalePosition) πŸŽ€

Change the position of the scale. Move over, scale β€” new spot just dropped.

  • Parameters
    • scalePosition β€” Position of the scale.
  • See also: ScalePosition, scalePosition()
  • Definition: Definition at line 213 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setSpacing (int spacing) πŸŽ€

Change the spacing between trough and scale. A spacing of 0 means, that the backbone of the scale is covered by the trough.

The default setting is 4 pixels.

  • Parameters
    • spacing β€” Number of pixels
  • See also: spacing();
  • Definition: Definition at line 278 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setTrough (bool on) πŸŽ€

En/Disable the trough. The slider can be customized by showing a trough for the handle.

  • Parameters
    • on β€” When true, the groove is visible
  • See also: hasTrough(), setGroove()
  • Definition: Definition at line 860 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::setUpdateInterval (int interval) πŸŽ€

Specify the update interval for automatic scrolling. The minimal accepted value is 50 ms.

  • Parameters
    • interval β€” Update interval in milliseconds
  • See also: setUpdateInterval()
  • Definition: Definition at line 395 of file qwt_slider.cpp.

πŸŽ€ QSize QwtSlider::sizeHint () const πŸŽ€

[override], [virtual]

Returns minimumSizeHint(). Yes, literally that. The size hint said "ask minimum size hint." Teamwork.

  • Returns β€” minimumSizeHint()
  • Definition: Definition at line 912 of file qwt_slider.cpp.

πŸŽ€ QRect QwtSlider::sliderRect () const πŸŽ€

[protected]

Returns the bounding rectangle of the slider β€” without the scale. Just the slider's own personal space.

  • Returns β€” Bounding rectangle of the slider - without the scale
  • Definition: Definition at line 1014 of file qwt_slider.cpp.

πŸŽ€ int QwtSlider::spacing () const πŸŽ€

Returns the number of pixels between slider and scale. Personal space, measured.

  • Returns β€” Number of pixels between slider and scale
  • See also: setSpacing()
  • Definition: Definition at line 296 of file qwt_slider.cpp.

πŸŽ€ void QwtSlider::timerEvent (QTimerEvent * event) πŸŽ€

[override], [protected], [virtual]

Timer event handler. Handles the timer, when the mouse stays pressed inside the sliderRect().

  • Parameters
    • event β€” Mouse event
  • Definition: Definition at line 633 of file qwt_slider.cpp.

πŸŽ€ int QwtSlider::updateInterval () const πŸŽ€

Returns the update interval in milliseconds for automatic scrolling. Automatic scrolling said "I have a schedule."

  • Returns β€” Update interval in milliseconds for automatic scrolling
  • See also: setUpdateInterval()
  • Definition: Definition at line 404 of file qwt_slider.cpp.

πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for Qwt User's Guide from the source code.


πŸ’– That's the whole page, bestie! Source/version vibes: Qwt User's Guide, QwtSlider(3), auto-generated by Doxygen for Qwt User's Guide from the source code. Date on the footer? Not printed in this excerpt, so I'm not inventing one β€” periodt. πŸŽ€

πŸ“¦ where this page comes from