Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickscrollindicator_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKSCROLLINDICATOR_P_H
6#define QQUICKSCROLLINDICATOR_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickTemplates2/private/qquickcontrol_p.h>
20
21QT_BEGIN_NAMESPACE
22
23class QQuickFlickable;
24class QQuickScrollIndicatorAttached;
26
27class Q_QUICKTEMPLATES2_EXPORT QQuickScrollIndicator : public QQuickControl
28{
29 Q_OBJECT
30 Q_PROPERTY(qreal size READ size WRITE setSize NOTIFY sizeChanged FINAL)
31 Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged FINAL)
32 Q_PROPERTY(bool active READ isActive WRITE setActive NOTIFY activeChanged FINAL)
33 Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation NOTIFY orientationChanged FINAL)
34 // 2.3 (Qt 5.10)
35 Q_PROPERTY(bool horizontal READ isHorizontal NOTIFY orientationChanged FINAL REVISION(2, 3))
36 Q_PROPERTY(bool vertical READ isVertical NOTIFY orientationChanged FINAL REVISION(2, 3))
37 // 2.4 (Qt 5.11)
38 Q_PROPERTY(qreal minimumSize READ minimumSize WRITE setMinimumSize NOTIFY minimumSizeChanged FINAL REVISION(2, 4))
39 Q_PROPERTY(qreal visualSize READ visualSize NOTIFY visualSizeChanged FINAL REVISION(2, 4))
40 Q_PROPERTY(qreal visualPosition READ visualPosition NOTIFY visualPositionChanged FINAL REVISION(2, 4))
41 QML_NAMED_ELEMENT(ScrollIndicator)
42 QML_ATTACHED(QQuickScrollIndicatorAttached)
43 QML_ADDED_IN_VERSION(2, 0)
44
45public:
46 explicit QQuickScrollIndicator(QQuickItem *parent = nullptr);
47
48 static QQuickScrollIndicatorAttached *qmlAttachedProperties(QObject *object);
49
50 qreal size() const;
51 qreal position() const;
52
53 bool isActive() const;
54 void setActive(bool active);
55
56 Qt::Orientation orientation() const;
57 void setOrientation(Qt::Orientation orientation);
58
59 // 2.3 (Qt 5.10)
60 bool isHorizontal() const;
61 bool isVertical() const;
62
63 // 2.4 (Qt 5.11)
64 qreal minimumSize() const;
65 void setMinimumSize(qreal minimumSize);
66
67 qreal visualSize() const;
68 qreal visualPosition() const;
69
70public Q_SLOTS:
71 void setSize(qreal size);
72 void setPosition(qreal position);
73
74Q_SIGNALS:
75 void sizeChanged();
76 void positionChanged();
77 void activeChanged();
78 void orientationChanged();
79 // 2.4 (Qt 5.11)
80 Q_REVISION(2, 4) void minimumSizeChanged();
81 Q_REVISION(2, 4) void visualSizeChanged();
82 Q_REVISION(2, 4) void visualPositionChanged();
83
84protected:
85#if QT_CONFIG(quicktemplates2_multitouch)
86 void touchEvent(QTouchEvent *event) override;
87#endif
88
89#if QT_CONFIG(accessibility)
90 QAccessible::Role accessibleRole() const override;
91#endif
92
93private:
94 Q_DISABLE_COPY(QQuickScrollIndicator)
95 Q_DECLARE_PRIVATE(QQuickScrollIndicator)
96};
97
99
100class Q_QUICKTEMPLATES2_EXPORT QQuickScrollIndicatorAttached : public QObject
101{
102 Q_OBJECT
103 Q_PROPERTY(QQuickScrollIndicator *horizontal READ horizontal WRITE setHorizontal NOTIFY horizontalChanged FINAL)
104 Q_PROPERTY(QQuickScrollIndicator *vertical READ vertical WRITE setVertical NOTIFY verticalChanged FINAL)
105
106public:
107 explicit QQuickScrollIndicatorAttached(QObject *parent = nullptr);
108 ~QQuickScrollIndicatorAttached();
109
110 QQuickScrollIndicator *horizontal() const;
111 void setHorizontal(QQuickScrollIndicator *horizontal);
112
113 QQuickScrollIndicator *vertical() const;
114 void setVertical(QQuickScrollIndicator *vertical);
115
116Q_SIGNALS:
117 void horizontalChanged();
118 void verticalChanged();
119
120private:
121 Q_DISABLE_COPY(QQuickScrollIndicatorAttached)
122 Q_DECLARE_PRIVATE(QQuickScrollIndicatorAttached)
123};
124
125QT_END_NAMESPACE
126
127#endif // QQUICKSCROLLINDICATOR_P_H
void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override
void itemImplicitHeightChanged(QQuickItem *item) override
void itemImplicitWidthChanged(QQuickItem *item) override
void itemDestroyed(QQuickItem *item) override
void visualAreaChange(const VisualArea &newVisualArea, const VisualArea &oldVisualArea)
static QT_BEGIN_NAMESPACE const QQuickItemPrivate::ChangeTypes QsiChangeTypes
Vertical or horizontal non-interactive scroll indicator.
static const QQuickItemPrivate::ChangeTypes QsiVerticalChangeTypes
static const QQuickItemPrivate::ChangeTypes QsiHorizontalChangeTypes