QSlider(3qt)

πŸ“¦ version 3.3.8b, in fedora 43, fedora 44

πŸ’… QSlider β€” the QSlider(3qt) manual, bestie edition πŸŽ€

okay so welcome to QSlider(3qt), the iconique vertical-or-horizontal slider page. grab a boba, this one's a long read but we're getting through every single bit of it together 🫢


✨ NAME ✨

QSlider β€” Vertical or horizontal slider πŸ’–


🌸 SYNOPSIS 🌸

#include <qslider.h>

Inherits QWidget and QRangeControl. yes she's got TWO parents and she's thriving, no cap πŸ’…

πŸ¦‹ Public Members πŸ¦‹

  • enum TickSetting { NoMarks = 0, Above = 1, Left = Above, Below = 2, Right = Below, Both = 3 }
  • QSlider ( QWidget * parent, const char * name = 0 )
  • QSlider ( Orientation orientation, QWidget * parent, const char * name = 0 )
  • QSlider ( int minValue, int maxValue, int pageStep, int value, Orientation orientation, QWidget * parent, const char * name = 0 )
  • ~QSlider ()
  • virtual void setOrientation ( Orientation )
  • Orientation orientation () const
  • virtual void setTracking ( bool enable )
  • bool tracking () const
  • virtual void setPalette ( const QPalette & p )
  • int sliderStart () const
  • QRect sliderRect () const
  • virtual void setTickmarks ( TickSetting )
  • TickSetting tickmarks () const
  • virtual void setTickInterval ( int )
  • int tickInterval () const
  • int minValue () const
  • int maxValue () const
  • void setMinValue ( int )
  • void setMaxValue ( int )
  • int lineStep () const
  • int pageStep () const
  • void setLineStep ( int )
  • void setPageStep ( int )
  • int value () const

πŸ“ Public Slots πŸ“

  • virtual void setValue ( int )
  • void addStep ()
  • void subtractStep ()

πŸ‘‘ Signals πŸ‘‘

  • void valueChanged ( int value )
  • void sliderPressed ()
  • void sliderMoved ( int value )
  • void sliderReleased ()

🌈 Important Inherited Members 🌈

  • void setRange ( int minValue, int maxValue )

🧚 Properties 🧚

  • int lineStep β€” the current line step
  • int maxValue β€” the current maximum value of the slider
  • int minValue β€” the current minimum value of the slider
  • Orientation orientation β€” the slider's orientation
  • int pageStep β€” the current page step
  • int tickInterval β€” the interval between tickmarks
  • TickSetting tickmarks β€” the tickmark settings for this slider
  • bool tracking β€” whether slider tracking is enabled
  • int value β€” the current slider value

πŸ’œ Protected Members πŸ’œ

  • virtual void valueChange ()
  • virtual void rangeChange ()

🌟 DESCRIPTION 🌟

The QSlider widget provides a vertical or horizontal slider. she does both, she contains multitudes πŸ’–

The slider is the classic widget for controlling a bounded value. It lets the user move a slider along a horizontal or vertical groove and translates the slider's position into an integer value within the legal range. it's giving "drag me, i dare you" ✨

QSlider inherits QRangeControl, which provides the "integer" side of the slider. setRange() and value() are likely to be used by practically all slider users; see the QRangeControl documentation for information about the many other functions that class provides. bestie fr fr, basically everyone touches those two πŸ’…

The main functions offered by the slider itself are tickmark and orientation control; you can use setTickmarks() to indicate where you want the tickmarks to be, setTickInterval() to indicate how many of them you want and setOrientation() to indicate whether the slider is to be horizontal or vertical. pick your vibe πŸŽ€

A slider accepts focus on Tab and uses the mouse wheel and a suitable keyboard interface. yes queen, tab-friendly AND scroll-friendly 🫢

[Image Omitted]

[Image Omitted]

See also QScrollBar, QSpinBox, GUI Design Handbook: Slider, and Basic Widgets. the whole friend group 😭

πŸ¦„ Member Type Documentation πŸ¦„

QSlider::TickSetting

This enum specifies where the tickmarks are to be drawn relative to the slider's groove and the handle the user moves. lowkey the most aesthetic part of the whole widget ngl 🌸

  • QSlider::NoMarks β€” do not draw any tickmarks. minimalist era, periodt πŸ’€
  • QSlider::Both β€” draw tickmarks on both sides of the groove. she's doing the MOST and we love her for it πŸ‘‘
  • QSlider::Above β€” draw tickmarks above the (horizontal) slider
  • QSlider::Below β€” draw tickmarks below the (horizontal) slider
  • QSlider::Left β€” draw tickmarks to the left of the (vertical) slider
  • QSlider::Right β€” draw tickmarks to the right of the (vertical) slider

πŸŽ€ MEMBER FUNCTION DOCUMENTATION πŸŽ€

QSlider::QSlider ( QWidget * parent, const char * name = 0 )

Constructs a vertical slider. it's vertical by default, that's just her natural state ✨

The parent and name arguments are sent on to the QWidget constructor. they get passed along like a group chat forward, no questions asked πŸ“±

QSlider::QSlider ( Orientation orientation, QWidget * parent, const char * name = 0 )

Constructs a slider.

The orientation must be Qt::Vertical or Qt::Horizontal. those are literally the only two options bestie, don't try anything else πŸ’…

The parent and name arguments are sent on to the QWidget constructor.

QSlider::QSlider ( int minValue, int maxValue, int pageStep, int value, Orientation orientation, QWidget * parent, const char * name = 0 )

Constructs a slider whose value can never be smaller than minValue or greater than maxValue, whose page step size is pageStep and whose value is initially value (which is guaranteed to be in range using bound()). she stays in her lane, respectfully πŸŽ€

If orientation is Qt::Vertical the slider is vertical and if it is Qt::Horizontal the slider is horizontal.

The parent and name arguments are sent on to the QWidget constructor.

QSlider::~QSlider ()

Destructor. bye bestie, thanks for the drags πŸ˜­πŸ’–

void QSlider::addStep () [slot]

Moves the slider one pageStep() up or right. go up, go right, live your truth β¬†οΈβž‘οΈ

int QSlider::lineStep () const

Returns the current line step. See the "lineStep" property for details.

int QSlider::maxValue () const

Returns the current maximum value of the slider. See the "maxValue" property for details.

int QSlider::minValue () const

Returns the current minimum value of the slider. See the "minValue" property for details.

Orientation QSlider::orientation () const

Returns the slider's orientation. See the "orientation" property for details.

int QSlider::pageStep () const

Returns the current page step. See the "pageStep" property for details.

void QSlider::rangeChange () [virtual protected]

Implements the virtual QRangeControl function.

Reimplemented from QRangeControl.

void QSlider::setLineStep ( int )

Sets the current line step. See the "lineStep" property for details.

void QSlider::setMaxValue ( int )

Sets the current maximum value of the slider. See the "maxValue" property for details.

void QSlider::setMinValue ( int )

Sets the current minimum value of the slider. See the "minValue" property for details.

void QSlider::setOrientation ( Orientation ) [virtual]

Sets the slider's orientation. See the "orientation" property for details.

void QSlider::setPageStep ( int )

Sets the current page step. See the "pageStep" property for details.

void QSlider::setPalette ( const QPalette & p ) [virtual]

Reimplements the virtual function QWidget::setPalette().

Sets the background color to the mid color for Motif style sliders using palette p. very Motif, very retro, very slay 🎨

Reimplemented from QWidget.

void QRangeControl::setRange ( int minValue, int maxValue )

Sets the range control's minimum value to minValue and its maximum value to maxValue.

Calls the virtual rangeChange() function if one or both of the new minimum and maximum values are different from the previous setting. Calls the virtual valueChange() function if the current value is adjusted because it was outside the new range.

If maxValue is smaller than minValue, minValue becomes the only legal value. ⚠️ yeah so the range collapses and minValue is the lone survivor, that's the rule.

See also minValue and maxValue.

Examples:

void QSlider::setTickInterval ( int ) [virtual]

Sets the interval between tickmarks. See the "tickInterval" property for details.

void QSlider::setTickmarks ( TickSetting ) [virtual]

Sets the tickmark settings for this slider. See the "tickmarks" property for details.

void QSlider::setTracking ( bool enable ) [virtual]

Sets whether slider tracking is enabled to enable. See the "tracking" property for details.

void QSlider::setValue ( int ) [virtual slot]

Sets the current slider value. See the "value" property for details.

void QSlider::sliderMoved ( int value ) [signal]

This signal is emitted when the slider is dragged, with the new slider value as its argument. she's MOVING and she's telling everyone πŸ“£

void QSlider::sliderPressed () [signal]

This signal is emitted when the user presses the slider with the mouse. click. the drama has begun πŸ–±οΈ

QRect QSlider::sliderRect () const

Returns the slider handle rectangle. (This is the visual marker that the user can move.) that lil guy right there, the one you drag, yes him 🫢

void QSlider::sliderReleased () [signal]

This signal is emitted when the user releases the slider with the mouse. let go, it's fine, you did great 😌

int QSlider::sliderStart () const

Returns the start position of the slider.

void QSlider::subtractStep () [slot]

Moves the slider one pageStep() down or left. down bad, left field, both valid ⬇️⬅️

int QSlider::tickInterval () const

Returns the interval between tickmarks. See the "tickInterval" property for details.

TickSetting QSlider::tickmarks () const

Returns the tickmark settings for this slider. See the "tickmarks" property for details.

bool QSlider::tracking () const

Returns TRUE if slider tracking is enabled; otherwise returns FALSE. See the "tracking" property for details.

int QSlider::value () const

Returns the current slider value. See the "value" property for details.

void QSlider::valueChange () [virtual protected]

Implements the virtual QRangeControl function.

Reimplemented from QRangeControl.

void QSlider::valueChanged ( int value ) [signal]

This signal is emitted when the slider value is changed, with the new slider value as its argument. new number, who dis ✨

Examples:

πŸ’– Property Documentation πŸ’–

int lineStep

This property holds the current line step.

When setting lineStep, the virtual stepChange() function will be called if the new line step is different from the previous setting.

See also setSteps(), QRangeControl::pageStep(), and setRange().

Set this property's value with setLineStep() and get this property's value with lineStep().

int maxValue

This property holds the current maximum value of the slider.

When setting this property, the QSlider::minValue is adjusted, if necessary, to ensure that the range remains valid. she'll pull the minimum along to keep things cute, no cap πŸ’…

See also setRange().

Set this property's value with setMaxValue() and get this property's value with maxValue().

int minValue

This property holds the current minimum value of the slider.

When setting this property, the QSlider::maxValue is adjusted, if necessary, to ensure that the range remains valid.

See also setRange().

Set this property's value with setMinValue() and get this property's value with minValue().

Orientation orientation

This property holds the slider's orientation.

The orientation must be Qt::Vertical (the default) or Qt::Horizontal. vertical is the default bestie, remember that 🌈

Set this property's value with setOrientation() and get this property's value with orientation().

int pageStep

This property holds the current page step.

When setting pageStep, the virtual stepChange() function will be called if the new page step is different from the previous setting.

See also QRangeControl::setSteps(), lineStep, and setRange().

Set this property's value with setPageStep() and get this property's value with pageStep().

int tickInterval</p> ✨

This property holds the interval between tickmarks, bestie. πŸŽ€

It's a value interval, not a pixel interval β€” no cap, don't get it twisted. If it's 0, the slider will choose between lineStep() and pageStep(). The initial value of tickInterval is 0.

See also QRangeControl::lineStep() and QRangeControl::pageStep().

Set this property's value with setTickInterval() and get this property's value with tickInterval(). πŸ’…


TickSetting tickmarks</p> πŸ¦‹

This property holds the tickmark settings for this slider.

The valid values are in QSlider::TickSetting. The default is NoMarks.

See also tickInterval.

Set this property's value with setTickmarks() and get this property's value with tickmarks(). ✨


bool tracking</p> πŸ‘‘

This property holds whether slider tracking is enabled.

If tracking is enabled (the default, periodt), the slider emits the valueChanged() signal whenever the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal when the user releases the mouse button (unless the value happens to be the same as before). 😌

Set this property's value with setTracking() and get this property's value with tracking(). πŸ’–


int value</p> 🌸

This property holds the current slider value.

Set this property's value with setValue() and get this property's value with value().

See also QRangeControl::value() and prevValue(). 🫢


SEE ALSO πŸ”₯


Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement.


AUTHOR 🧚

Generated automatically from the source code. (iconic behaviour honestly, the code just wrote its own memoir ✨)


BUGS πŸ’€

If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. πŸ™

The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech.

If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qslider.3qt) and the Qt version (3.3.8). πŸ“

And that's a wrap, bestie β€” no notes, we ate. πŸŽ€ This lil' page came from Trolltech AS, dated 2 February 2007, for QSlider(3qt). Go forth and slide those values, main character. πŸ’…βœ¨πŸŒˆ

πŸ“¦ where this page comes from