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 goingQt::Orientation orientation() constvoid setScalePosition(ScalePosition)β Change the position of the scale.ScalePosition scalePosition() constvoid setTrough(bool)bool hasTrough() constvoid setGroove(bool)bool hasGroove() constvoid setHandleSize(const QSize &)β Set the slider's handle size. give the handle the size it deserves πQSize handleSize() constvoid setBorderWidth(int)β Change the slider's border width.int borderWidth() constvoid setSpacing(int)β Change the spacing between trough and scale.int spacing() constvirtual QSize sizeHint() const overridevirtual QSize minimumSizeHint() const overridevoid setScaleDraw(QwtScaleDraw *)β Set a scale draw.const QwtScaleDraw * scaleDraw() constvoid 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() 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 π
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() 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 π
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 &) constvirtual void drawHandle(QPainter *, const QRect &, int pos) constvirtual void mousePressEvent(QMouseEvent *) overridevirtual void mouseReleaseEvent(QMouseEvent *) overridevirtual void resizeEvent(QResizeEvent *) overridevirtual void paintEvent(QPaintEvent *) overridevirtual void changeEvent(QEvent *) overridevirtual void timerEvent(QTimerEvent *) overridevirtual bool event(QEvent *) overridevirtual void scaleChange() overrideβ Notify changed scale.QRect sliderRect() constQRect handleRect() const
π Protected Member Functions inherited from QwtAbstractSlider π
virtual void mouseMoveEvent(QMouseEvent *) overridevirtual void keyPressEvent(QKeyEvent *) overridevirtual void wheelEvent(QWheelEvent *) overridevoid incrementValue(int stepCount)virtual void sliderChange()β Callingupdate().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() constQwtAbstractScaleDraw * 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 line30of fileqwt_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 line54of fileqwt_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 line119of fileqwt_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 line136of fileqwt_slider.cpp.
QwtSlider::~QwtSlider() [virtual]
Destructor. it's the goodbye era ππ
Definition at line143of fileqwt_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β PainterhandleRectβ Bounding rectangle of the handleposβ 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β PaintersliderRectβ 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 areQt::HorizontalandQt::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 withnewand will be deleted in~QwtSlider()or the next call ofsetScaleDraw().
- 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
- 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