Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qslider.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QSLIDER_H
5#define QSLIDER_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8
9#include <QtWidgets/qabstractslider.h>
10
12
14
15class QSliderPrivate;
16class QStyleOptionSlider;
17class Q_WIDGETS_EXPORT QSlider : public QAbstractSlider
18{
20
21 Q_PROPERTY(TickPosition tickPosition READ tickPosition WRITE setTickPosition)
22 Q_PROPERTY(int tickInterval READ tickInterval WRITE setTickInterval)
23
24public:
26 NoTicks = 0,
27 TicksAbove = 1,
28 TicksLeft = TicksAbove,
29 TicksBelow = 2,
30 TicksRight = TicksBelow,
31 TicksBothSides = 3
32 };
33 Q_ENUM(TickPosition)
34
35 explicit QSlider(QWidget *parent = nullptr);
36 explicit QSlider(Qt::Orientation orientation, QWidget *parent = nullptr);
37
38 ~QSlider();
39
40 QSize sizeHint() const override;
41 QSize minimumSizeHint() const override;
42
43 void setTickPosition(TickPosition position);
44 TickPosition tickPosition() const;
45
46 void setTickInterval(int ti);
47 int tickInterval() const;
48
49 bool event(QEvent *event) override;
50
51protected:
52 void paintEvent(QPaintEvent *ev) override;
53 void mousePressEvent(QMouseEvent *ev) override;
54 void mouseReleaseEvent(QMouseEvent *ev) override;
55 void mouseMoveEvent(QMouseEvent *ev) override;
56 virtual void initStyleOption(QStyleOptionSlider *option) const;
57
58
59private:
60 friend Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider);
61
62 Q_DISABLE_COPY(QSlider)
63 Q_DECLARE_PRIVATE(QSlider)
64};
65
67
68#endif // QSLIDER_H
The QAbstractSlider class provides an integer value within a range.
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtGui
Definition qevent.h:196
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
\inmodule QtCore
Definition qsize.h:25
The QSlider widget provides a vertical or horizontal slider.
Definition qslider.h:18
TickPosition
This enum specifies where the tick marks are to be drawn relative to the slider's groove and the hand...
Definition qslider.h:25
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
Combined button and popup list for selecting options.
Orientation
Definition qnamespace.h:98
struct _cl_event * event
GLuint GLenum option
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider)
Definition qslider.cpp:509
#define QT_REQUIRE_CONFIG(feature)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT