CopperSpice API  1.9.1
QAbstractSlider Class Reference

The QAbstractSlider class provides an integer value within a range. More...

Inheritance diagram for QAbstractSlider:
QWidget QObject QPaintDevice QDial QScrollBar QSlider

Public Types

enum  SliderAction
 
- Public Types inherited from QWidget
enum  RenderFlag
 
- Public Types inherited from QPaintDevice
enum  PaintDeviceMetric
 

Public Signals

void actionTriggered (int action)
 
void rangeChanged (int min, int max)
 
void sliderMoved (int pos)
 
void sliderPressed ()
 
void sliderReleased ()
 
void valueChanged (int value)
 
- Public Signals inherited from QWidget
void customContextMenuRequested (const QPoint &pos)
 
void windowIconChanged (const QIcon &icon)
 
void windowIconTextChanged (const QString &iconText)
 
void windowTitleChanged (const QString &title)
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 

Public Slots

void setOrientation (Qt::Orientation orientation)
 
void setRange (int min, int max)
 
void setValue (int value)
 
- Public Slots inherited from QWidget
bool close ()
 
void hide ()
 
void lower ()
 
void raise ()
 
void repaint ()
 
void setDisabled (bool disable)
 
void setEnabled (bool enable)
 
void setFocus ()
 
void setHidden (bool hidden)
 
void setStyleSheet (const QString &styleSheet)
 
virtual void setVisible (bool visible)
 
void setWindowModified (bool modified)
 
void setWindowTitle (const QString &title)
 
void show ()
 
void showFullScreen ()
 
void showMaximized ()
 
void showMinimized ()
 
void showNormal ()
 
void update ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Public Methods

 QAbstractSlider (QWidget *parent=nullptr)
 
 ~QAbstractSlider ()
 
bool hasTracking () const
 
bool invertedAppearance () const
 
bool invertedControls () const
 
bool isSliderDown () const
 
int maximum () const
 
int minimum () const
 
Qt::Orientation orientation () const
 
int pageStep () const
 
void setInvertedAppearance (bool enable)
 
void setInvertedControls (bool enable)
 
void setMaximum (int value)
 
void setMinimum (int value)
 
void setPageStep (int value)
 
void setSingleStep (int value)
 
void setSliderDown (bool enable)
 
void setSliderPosition (int value)
 
void setTracking (bool enable)
 
int singleStep () const
 
int sliderPosition () const
 
void triggerAction (SliderAction action)
 
int value () const
 
- Public Methods inherited from QWidget
 QWidget (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
 ~QWidget ()
 
bool acceptDrops () const
 
QString accessibleDescription () const
 
QString accessibleName () const
 
QList< QAction * > actions () const
 
void activateWindow ()
 
void addAction (QAction *action)
 
void addActions (const QList< QAction * > &actions)
 
void adjustSize ()
 
bool autoFillBackground () const
 
QPalette::ColorRole backgroundRole () const
 
QBackingStorebackingStore () const
 
QSize baseSize () const
 
QWidget * childAt (const QPoint &position) const
 
QWidget * childAt (int x, int y) const
 
QRect childrenRect () const
 
QRegion childrenRegion () const
 
void clearFocus ()
 
void clearMask ()
 
QMargins contentsMargins () const
 
QRect contentsRect () const
 
Qt::ContextMenuPolicy contextMenuPolicy () const
 
QCursor cursor () const
 
WId effectiveWinId () const
 
void ensurePolished () const
 
Qt::FocusPolicy focusPolicy () const
 
QWidget * focusProxy () const
 
QWidget * focusWidget () const
 
const QFontfont () const
 
QFontInfo fontInfo () const
 
QFontMetrics fontMetrics () const
 
QPalette::ColorRole foregroundRole () const
 
QRect frameGeometry () const
 
QSize frameSize () const
 
const QRectgeometry () const
 
void getContentsMargins (int *left, int *top, int *right, int *bottom) const
 
QPixmap grab (const QRect &rectangle=QRect (QPoint (0, 0), QSize (-1,-1)))
 
void grabGesture (Qt::GestureType gestureType, Qt::GestureFlags flags=Qt::GestureFlags ())
 
void grabKeyboard ()
 
void grabMouse ()
 
void grabMouse (const QCursor &cursor)
 
int grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut)
 
QGraphicsEffectgraphicsEffect () const
 
QGraphicsProxyWidgetgraphicsProxyWidget () const
 
bool hasEditFocus () const
 
bool hasFocus () const
 
virtual bool hasHeightForWidth () const
 
bool hasMouseTracking () const
 
int height () const
 
virtual int heightForWidth (int width) const
 
Qt::InputMethodHints inputMethodHints () const
 
virtual QVariant inputMethodQuery (Qt::InputMethodQuery query) const
 
void insertAction (QAction *before, QAction *action)
 
void insertActions (QAction *before, QList< QAction * > actions)
 
bool isActiveWindow () const
 
bool isAncestorOf (const QWidget *child) const
 
bool isEnabled () const
 
bool isEnabledTo (const QWidget *parent) const
 
bool isEnabledToTLW () const
 
bool isFullScreen () const
 
bool isHidden () const
 
bool isMaximized () const
 
bool isMinimized () const
 
bool isModal () const
 
bool isTopLevel () const
 
bool isVisible () const
 
bool isVisibleTo (const QWidget *parent) const
 
bool isWindow () const
 
bool isWindowModified () const
 
QLayoutlayout () const
 
Qt::LayoutDirection layoutDirection () const
 
QLocale locale () const
 
QPoint mapFrom (const QWidget *parent, const QPoint &pos) const
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapFromParent (const QPoint &pos) const
 
QPoint mapTo (const QWidget *parent, const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QPoint mapToParent (const QPoint &pos) const
 
QRegion mask () const
 
int maximumHeight () const
 
QSize maximumSize () const
 
int maximumWidth () const
 
int minimumHeight () const
 
QSize minimumSize () const
 
virtual QSize minimumSizeHint () const
 
int minimumWidth () const
 
void move (const QPoint &point)
 
void move (int x, int y)
 
QWidget * nativeParentWidget () const
 
QWidget * nextInFocusChain () const
 
QRect normalGeometry () const
 
void overrideWindowFlags (Qt::WindowFlags flags)
 
QPaintEnginepaintEngine () const override
 
const QPalettepalette () const
 
QWidget * parentWidget () const
 
QPoint pos () const
 
QWidget * previousInFocusChain () const
 
QRect rect () const
 
void releaseKeyboard ()
 
void releaseMouse ()
 
void releaseShortcut (int id)
 
void removeAction (QAction *action)
 
void render (QPaintDevice *target, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren))
 
void render (QPainter *painter, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren))
 
void repaint (const QRect &rect)
 
void repaint (const QRegion &region)
 
void repaint (int x, int y, int w, int h)
 
void resize (const QSize &size)
 
void resize (int w, int h)
 
bool restoreGeometry (const QByteArray &geometry)
 
QByteArray saveGeometry () const
 
void scroll (int dx, int dy)
 
void scroll (int dx, int dy, const QRect &rect)
 
void setAcceptDrops (bool on)
 
void setAccessibleDescription (const QString &description)
 
void setAccessibleName (const QString &name)
 
void setAttribute (Qt::WidgetAttribute attribute, bool enable=true)
 
void setAutoFillBackground (bool enable)
 
void setBackgroundRole (QPalette::ColorRole role)
 
void setBaseSize (const QSize &size)
 
void setBaseSize (int basew, int baseh)
 
void setContentsMargins (const QMargins &margins)
 
void setContentsMargins (int left, int top, int right, int bottom)
 
void setContextMenuPolicy (Qt::ContextMenuPolicy policy)
 
void setCursor (const QCursor &cursor)
 
void setEditFocus (bool enable)
 
void setFixedHeight (int h)
 
void setFixedSize (const QSize &size)
 
void setFixedSize (int w, int h)
 
void setFixedWidth (int w)
 
void setFocus (Qt::FocusReason reason)
 
void setFocusPolicy (Qt::FocusPolicy policy)
 
void setFocusProxy (QWidget *widget)
 
void setFont (const QFont &font)
 
void setForegroundRole (QPalette::ColorRole role)
 
void setGeometry (const QRect &rect)
 
void setGeometry (int x, int y, int w, int h)
 
void setGraphicsEffect (QGraphicsEffect *effect)
 
void setInputMethodHints (Qt::InputMethodHints hints)
 
void setLayout (QLayout *layout)
 
void setLayoutDirection (Qt::LayoutDirection direction)
 
void setLocale (const QLocale &locale)
 
void setMask (const QBitmap &bitmap)
 
void setMask (const QRegion &region)
 
void setMaximumHeight (int maxh)
 
void setMaximumSize (const QSize &size)
 
void setMaximumSize (int maxw, int maxh)
 
void setMaximumWidth (int maxw)
 
void setMinimumHeight (int minh)
 
void setMinimumSize (const QSize &size)
 
void setMinimumSize (int minw, int minh)
 
void setMinimumWidth (int minw)
 
void setMouseTracking (bool enable)
 
void setPalette (const QPalette &palette)
 
void setParent (QWidget *parent)
 
void setParent (QWidget *parent, Qt::WindowFlags flags)
 
void setShortcutAutoRepeat (int id, bool enable=true)
 
void setShortcutEnabled (int id, bool enable=true)
 
void setSizeIncrement (const QSize &size)
 
void setSizeIncrement (int w, int h)
 
void setSizePolicy (QSizePolicy policy)
 
void setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical)
 
void setStatusTip (const QString &data)
 
void setStyle (QStyle *style)
 
void setToolTip (const QString &data)
 
void setToolTipDuration (int msec)
 
void setUpdatesEnabled (bool enable)
 
void setWhatsThis (const QString &str)
 
void setWindowFilePath (const QString &filePath)
 
void setWindowFlags (Qt::WindowFlags flags)
 
void setWindowIcon (const QIcon &icon)
 
void setWindowModality (Qt::WindowModality windowModality)
 
void setWindowOpacity (qreal level)
 
void setWindowRole (const QString &role)
 
void setWindowState (Qt::WindowStates windowState)
 
QSize size () const
 
virtual QSize sizeHint () const
 
QSize sizeIncrement () const
 
QSizePolicy sizePolicy () const
 
void stackUnder (QWidget *widget)
 
QString statusTip () const
 
QStylestyle () const
 
QString styleSheet () const
 
bool testAttribute (Qt::WidgetAttribute attribute) const
 
QString toolTip () const
 
int toolTipDuration () const
 
QWidget * topLevelWidget () const
 
bool underMouse () const
 
void ungrabGesture (Qt::GestureType gestureType)
 
void unsetCursor ()
 
void unsetLayoutDirection ()
 
void unsetLocale ()
 
void update (const QRect &rect)
 
void update (const QRegion &region)
 
void update (int x, int y, int w, int h)
 
void updateGeometry ()
 
bool updatesEnabled () const
 
QRegion visibleRegion () const
 
QString whatsThis () const
 
int width () const
 
QWidget * window () const
 
QString windowFilePath () const
 
Qt::WindowFlags windowFlags () const
 
QWindowwindowHandle () const
 
QIcon windowIcon () const
 
Qt::WindowModality windowModality () const
 
qreal windowOpacity () const
 
QString windowRole () const
 
Qt::WindowStates windowState () const
 
QString windowTitle () const
 
Qt::WindowType windowType () const
 
WId winId () const
 
int x () const
 
int y () const
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool event (QEvent *event)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 
- Public Methods inherited from QPaintDevice
virtual ~QPaintDevice ()
 
int colorCount () const
 
int depth () const
 
int devicePixelRatio () const
 
qreal devicePixelRatioF () const
 
int height () const
 
int heightMM () const
 
int logicalDpiX () const
 
int logicalDpiY () const
 
bool paintingActive () const
 
int physicalDpiX () const
 
int physicalDpiY () const
 
int width () const
 
int widthMM () const
 

Protected Types

enum  SliderChange
 

Protected Methods

void changeEvent (QEvent *event) override
 
bool event (QEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
SliderAction repeatAction () const
 
void setRepeatAction (SliderAction action, int thresholdTime=500, int repeatTime=50)
 
virtual void sliderChange (SliderChange change)
 
void timerEvent (QTimerEvent *event) override
 
void wheelEvent (QWheelEvent *event) override
 
- Protected Methods inherited from QWidget
virtual void actionEvent (QActionEvent *event)
 
virtual void closeEvent (QCloseEvent *event)
 
virtual void contextMenuEvent (QContextMenuEvent *event)
 
void create (WId window=0, bool initializeWindow=true, bool destroyOldWindow=true)
 
void destroy (bool destroyWindow=true, bool destroySubWindows=true)
 
virtual void dragEnterEvent (QDragEnterEvent *event)
 
virtual void dragLeaveEvent (QDragLeaveEvent *event)
 
virtual void dragMoveEvent (QDragMoveEvent *event)
 
virtual void dropEvent (QDropEvent *event)
 
virtual void enterEvent (QEvent *event)
 
bool event (QEvent *event) override
 
virtual void focusInEvent (QFocusEvent *event)
 
bool focusNextChild ()
 
virtual bool focusNextPrevChild (bool next)
 
virtual void focusOutEvent (QFocusEvent *event)
 
bool focusPreviousChild ()
 
virtual void hideEvent (QHideEvent *event)
 
void initPainter (QPainter *painter) const override
 
virtual void inputMethodEvent (QInputMethodEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
virtual void leaveEvent (QEvent *event)
 
int metric (PaintDeviceMetric metric) const override
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void moveEvent (QMoveEvent *event)
 
virtual bool nativeEvent (const QByteArray &eventType, void *message, long *result)
 
virtual void paintEvent (QPaintEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void showEvent (QShowEvent *event)
 
virtual void tabletEvent (QTabletEvent *event)
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Protected Methods inherited from QPaintDevice
 QPaintDevice ()
 

Properties

 invertedAppearance
 
 invertedControls
 
 maximum
 
 minimum
 
 orientation
 
 pageStep
 
 singleStep
 
 sliderDown
 
 sliderPosition
 
 tracking
 
 value
 
- Properties inherited from QWidget
 acceptDrops
 
 accessibleDescription
 
 accessibleName
 
 autoFillBackground
 
 baseSize
 
 childrenRect
 
 childrenRegion
 
 contextMenuPolicy
 
 cursor
 
 enabled
 
 focus
 
 focusPolicy
 
 font
 
 frameGeometry
 
 frameSize
 
 fullScreen
 
 geometry
 
 height
 
 inputMethodHints
 
 isActiveWindow
 
 layoutDirection
 
 locale
 
 maximized
 
 maximumHeight
 
 maximumSize
 
 maximumWidth
 
 minimized
 
 minimumHeight
 
 minimumSize
 
 minimumSizeHint
 
 minimumWidth
 
 modal
 
 mouseTracking
 
 normalGeometry
 
 palette
 
 pos
 
 rect
 
 size
 
 sizeHint
 
 sizeIncrement
 
 sizePolicy
 
 statusTip
 
 styleSheet
 
 toolTip
 
 updatesEnabled
 
 visible
 
 whatsThis
 
 width
 
 windowFilePath
 
 windowFlags
 
 windowIcon
 
 windowIconText
 
 windowModality
 
 windowModified
 
 windowOpacity
 
 windowTitle
 
 x
 
 y
 
- Properties inherited from QObject
 objectName
 

Additional Inherited Members

- Public Typedefs inherited from QWidget
using RenderFlags = QFlags< RenderFlag >
 
- Static Public Methods inherited from QWidget
static QWidget * createWindowContainer (QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag)
 
static QWidget * find (WId id)
 
static QWidget * keyboardGrabber ()
 
static QWidget * mouseGrabber ()
 
static void setTabOrder (QWidget *firstWidget, QWidget *secondWidget)
 
- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 
- Protected Slots inherited from QWidget
void updateMicroFocus ()
 

Detailed Description

The QAbstractSlider class provides an integer value within a range. The class is designed as a common super class for widgets like QScrollBar, QSlider and QDial. These are the main properties of the class.

The setValue() method is used to set the current value to any integer in the allowed range. Some widgets may allow the user to set any value. Other widgets may require the value to be a multiple of singleStep() or pageStep().

QAbstractSlider::value
Bounded integer that QAbstractSlider maintains.
QAbstractSlider::minimum
Lowest possible value.
QAbstractSlider::maximum
Highest possible value.
QAbstractSlider::singleStep
The smaller of two natural steps that an abstract sliders provides and typically corresponds to the user pressing an arrow key.
QAbstractSlider::pageStep
The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown.
QAbstractSlider::tracking
Whether slider tracking is enabled.
QAbstractSlider::sliderPosition
The current position of the slider. If tracking is enabled (the default), this is identical to value.

Methods and Signals

This class provides the sliderChange() method which is used to update the on screen representation of sliders. Inherited classes can simulate a slider action by calling triggerAction(). The two methods QStyle::sliderPositionFromValue() and QStyle::sliderValueFromPosition() can be used by inherited classes or style classes to map screen coordinates to logical range values.

QAbstractSlider emits a comprehensive set of signals as shown below.

SignalEmitted When
valueChanged()Value has changed. The tracking determines whether this signal is emitted during user interaction.
sliderPressed()User starts to drag the slider.
sliderMoved()User drags the slider.
sliderReleased()User releases the slider.
actionTriggered()Slider action was triggered.
rangeChanged()Range changed.
See also
QAbstractSpinBox, QDial, QScrollBar, QSlider

Member Enumeration Documentation

This enum describes the possible actions for a slider.

ConstantValue
QAbstractSlider::SliderNoAction0
QAbstractSlider::SliderSingleStepAdd1
QAbstractSlider::SliderSingleStepSub2
QAbstractSlider::SliderPageStepAdd3
QAbstractSlider::SliderPageStepSub4
QAbstractSlider::SliderToMinimum5
QAbstractSlider::SliderToMaximum6
QAbstractSlider::SliderMove7

This enum describes the attributes which can be modified on a slider.

ConstantValue
QAbstractSlider::SliderRangeChange0
QAbstractSlider::SliderOrientationChange1
QAbstractSlider::SliderStepsChange2
QAbstractSlider::SliderValueChange3

Constructor & Destructor Documentation

QAbstractSlider::QAbstractSlider ( QWidget parent = nullptr)
explicit

Constructs an abstract slider. The parent argument is sent to the QWidget constructor. The minimum defaults to 0, the maximum to 99, with a singleStep size of 1 and a pageStep size of 10, and an initial value of 0.

QAbstractSlider::~QAbstractSlider ( )

Destroys the slider.

Method Documentation

void QAbstractSlider::actionTriggered ( int  action)
signal

This signal is emitted when the given action is triggered. Actions are SliderSingleStepAdd, SliderSingleStepSub, SliderPageStepAdd, SliderPageStepSub, SliderToMinimum, SliderToMaximum, and SliderMove.

When the signal is emitted, the sliderPosition has been adjusted according to the action, but the value has not yet been propagated (meaning the valueChanged() signal was not yet emitted), and the visual display has not been updated. In slots connected to this signal you can thus safely adjust any action by calling setSliderPosition() yourself, based on both the action and the slider's value.

See also
triggerAction()
void QAbstractSlider::changeEvent ( QEvent event)
overrideprotectedvirtual

Reimplemented from QWidget::changeEvent()

bool QAbstractSlider::event ( QEvent event)
overrideprotected

Reimplemented from QWidget::event()

bool QAbstractSlider::hasTracking ( ) const

Returns the value of the property.

bool QAbstractSlider::invertedAppearance ( ) const

Returns the value of the property.

bool QAbstractSlider::invertedControls ( ) const

Returns the value of the property.

bool QAbstractSlider::isSliderDown ( ) const

Returns the value of the property.

void QAbstractSlider::keyPressEvent ( QKeyEvent event)
overrideprotectedvirtual

Reimplemented from QWidget::keyPressEvent()

int QAbstractSlider::maximum ( ) const

Returns the value of the property.

int QAbstractSlider::minimum ( ) const

Returns the value of the property.

Qt::Orientation QAbstractSlider::orientation ( ) const

Returns the value of the property.

int QAbstractSlider::pageStep ( ) const

Returns the value of the property.

void QAbstractSlider::rangeChanged ( int  min,
int  max 
)
signal

This signal is emitted when the slider range has changed, with min being the new minimum, and max being the new maximum.

See also
minimum, maximum
SliderAction QAbstractSlider::repeatAction ( ) const
protected

Returns the current repeat action.

See also
setRepeatAction()
void QAbstractSlider::setInvertedAppearance ( bool  enable)

Sets the value of the property to enable.

void QAbstractSlider::setInvertedControls ( bool  enable)

Sets the value of the property to enable.

void QAbstractSlider::setMaximum ( int  value)

Sets the value of the property to value.

void QAbstractSlider::setMinimum ( int  value)

Sets the value of the property to value.

void QAbstractSlider::setOrientation ( Qt::Orientation  orientation)
slot

Sets the value of the property to orientation.

void QAbstractSlider::setPageStep ( int  value)

Sets the value of the property to value.

void QAbstractSlider::setRange ( int  min,
int  max 
)
slot

Sets the slider's minimum to min and its maximum to max. If max is smaller than min then >min becomes the only valid value.

See also
minimum, maximum
void QAbstractSlider::setRepeatAction ( SliderAction  action,
int  thresholdTime = 500,
int  repeatTime = 50 
)
protected

Sets action to be triggered repetitively in intervals of repeatTime, after an initial delay of thresholdTime.

See also
triggerAction(), repeatAction()
void QAbstractSlider::setSingleStep ( int  value)

Sets the value of the property to value.

void QAbstractSlider::setSliderDown ( bool  enable)

Sets the value of the property to enable.

void QAbstractSlider::setSliderPosition ( int  value)

Sets the value of the property to value.

void QAbstractSlider::setTracking ( bool  enable)

Sets the value of the property to enable.

void QAbstractSlider::setValue ( int  value)
slot

Sets the value of the property to value.

int QAbstractSlider::singleStep ( ) const

Returns the value of the property.

void QAbstractSlider::sliderChange ( SliderChange  change)
protectedvirtual

Reimplement this method to track slider changes such as SliderRangeChange, SliderOrientationChange, SliderStepsChange, or SliderValueChange. The default implementation only updates the display and ignores the change parameter.

Reimplemented in QDial::sliderChange(), QScrollBar::sliderChange()

void QAbstractSlider::sliderMoved ( int  pos)
signal

This signal is emitted when sliderDown is true and the slider moves. This usually happens when the user is dragging the slider. The pos is the new slider position. This signal is emitted even when tracking is turned off.

See also
setTracking(), valueChanged(), isSliderDown(), sliderPressed(), sliderReleased()
int QAbstractSlider::sliderPosition ( ) const

Returns the value of the property.

void QAbstractSlider::sliderPressed ( )
signal

This signal is emitted when the user presses the slider with the mouse, or programmatically when setSliderDown(true) is called.

See also
sliderReleased(), sliderMoved(), isSliderDown()
void QAbstractSlider::sliderReleased ( )
signal

This signal is emitted when the user releases the slider with the mouse, or programmatically when setSliderDown(false) is called.

See also
sliderPressed(), sliderMoved(), sliderDown
void QAbstractSlider::timerEvent ( QTimerEvent event)
overrideprotected

Reimplemented from QObject::timerEvent()

void QAbstractSlider::triggerAction ( SliderAction  action)

Triggers a slider action. Possible actions are SliderSingleStepAdd, SliderSingleStepSub, SliderPageStepAdd, SliderPageStepSub, SliderToMinimum, SliderToMaximum, and SliderMove.

See also
actionTriggered()
int QAbstractSlider::value ( ) const

Returns the value of the property.

void QAbstractSlider::valueChanged ( int  value)
signal

This signal is emitted when the given slider value has changed.

void QAbstractSlider::wheelEvent ( QWheelEvent event)
overrideprotectedvirtual

Reimplemented from QWidget::wheelEvent()

Reimplemented in QScrollBar::wheelEvent()

Property Documentation

QAbstractSlider::invertedAppearance

This property holds whether or not a slider shows its values inverted. If this property is false (the default), the minimum and maximum will be shown in its classic position for the inherited widget. If the value is true, the minimum and maximum appear at their opposite location.

This property makes most sense for sliders and dials. For scroll bars, the visual effect of the scroll bar subcontrols depends on whether or not the styles understand inverted appearance; most styles ignore this property for scroll bars.

PropertiesClass Methods
read invertedAppearance
write setInvertedAppearance
QAbstractSlider::invertedControls

This property holds whether or not the slider inverts its wheel and key events.

If this property is false, scrolling the mouse wheel "up" and using keys like page up will increase the slider's value towards its maximum. Otherwise pressing page up will move value towards the slider's minimum.

PropertiesClass Methods
read invertedControls
write setInvertedControls
QAbstractSlider::maximum

This property holds the slider's maximum value.

When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.

PropertiesClass Methods
read maximum
write setMaximum
QAbstractSlider::minimum

This property holds the slider's minimum value.

When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.

PropertiesClass Methods
read minimum
write setMinimum
QAbstractSlider::orientation

This property holds the orientation of the slider. The orientation must be Qt::Vertical (the default) or Qt::Horizontal.

PropertiesClass Methods
read orientation
write setOrientation
QAbstractSlider::pageStep

This property holds the page step. The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown.

See also
singleStep
PropertiesClass Methods
read pageStep
write setPageStep
QAbstractSlider::singleStep

This property holds the single step. The smaller of two natural steps that an abstract sliders provides and typically corresponds to the user pressing an arrow key. If the property is modified during an auto repeating key event, behavior is undefined.

See also
pageStep
PropertiesClass Methods
read singleStep
write setSingleStep
QAbstractSlider::sliderDown

This property holds whether the slider is pressed down. The property is set by subclasses in order to let the abstract slider know whether or not tracking has any effect. Changing the slider down property emits the sliderPressed() and sliderReleased() signals.

PropertiesClass Methods
read isSliderDown
write setSliderDown
designable true
QAbstractSlider::sliderPosition

This property holds the current slider position. If tracking is enabled (the default), this is identical to value.

PropertiesClass Methods
read sliderPosition
write setSliderPosition
notify sliderMoved
QAbstractSlider::tracking

This property holds whether slider tracking is enabled.

If tracking is enabled (the default), the slider emits the valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.

See also
sliderDown
PropertiesClass Methods
read hasTracking
write setTracking
QAbstractSlider::value

This property holds the slider's current value. The slider forces the value to be within the legal range: minimum <= value <= maximum. Changing the value also changes the sliderPosition.

PropertiesClass Methods
read value
write setValue
notify valueChanged
user true