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
qquickswipe_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 QQUICKSWIPE_P_H
6#define QQUICKSWIPE_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 <QtCore/qobject.h>
20#include <QtQuickTemplates2/private/qtquicktemplates2global_p.h>
21#include <QtQuickTemplates2/private/qquickswipedelegate_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QQmlComponent;
26class QQuickItem;
27class QQuickTransition;
29
30class Q_QUICKTEMPLATES2_EXPORT QQuickSwipe : public QObject
31{
32 Q_OBJECT
33 Q_PROPERTY(qreal position READ position WRITE setPosition NOTIFY positionChanged FINAL)
34 Q_PROPERTY(bool complete READ isComplete NOTIFY completeChanged FINAL)
35 Q_PROPERTY(QQmlComponent *left READ left WRITE setLeft NOTIFY leftChanged FINAL)
36 Q_PROPERTY(QQmlComponent *behind READ behind WRITE setBehind NOTIFY behindChanged FINAL)
37 Q_PROPERTY(QQmlComponent *right READ right WRITE setRight NOTIFY rightChanged FINAL)
38 Q_PROPERTY(QQuickItem *leftItem READ leftItem NOTIFY leftItemChanged FINAL)
39 Q_PROPERTY(QQuickItem *behindItem READ behindItem NOTIFY behindItemChanged FINAL)
40 Q_PROPERTY(QQuickItem *rightItem READ rightItem NOTIFY rightItemChanged FINAL)
41 // 2.2 (Qt 5.9)
42 Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) // REVISION(2, 2)
43 Q_PROPERTY(QQuickTransition *transition READ transition WRITE setTransition NOTIFY transitionChanged FINAL) // REVISION(2, 2)
44 QML_ANONYMOUS
45 QML_ADDED_IN_VERSION(2, 0)
46
47public:
48 explicit QQuickSwipe(QQuickSwipeDelegate *control);
49
50 qreal position() const;
51 void setPosition(qreal position);
52
53 bool isComplete() const;
54 void setComplete(bool complete);
55
56 QQmlComponent *left() const;
57 void setLeft(QQmlComponent *left);
58
59 QQmlComponent *behind() const;
60 void setBehind(QQmlComponent *behind);
61
62 QQmlComponent *right() const;
63 void setRight(QQmlComponent *right);
64
65 QQuickItem *leftItem() const;
66 void setLeftItem(QQuickItem *item);
67
68 QQuickItem *behindItem() const;
69 void setBehindItem(QQuickItem *item);
70
71 QQuickItem *rightItem() const;
72 void setRightItem(QQuickItem *item);
73
74 // 2.1 (Qt 5.8)
75 Q_REVISION(2, 1) Q_INVOKABLE void close();
76
77 // 2.2 (Qt 5.9)
78 bool isEnabled() const;
79 void setEnabled(bool enabled);
80
81 QQuickTransition *transition() const;
82 void setTransition(QQuickTransition *transition);
83
84 Q_REVISION(2, 2) Q_INVOKABLE void open(QQuickSwipeDelegate::Side side);
85
86Q_SIGNALS:
87 void positionChanged();
88 void completeChanged();
89 void leftChanged();
90 void behindChanged();
91 void rightChanged();
92 void leftItemChanged();
93 void behindItemChanged();
94 void rightItemChanged();
95 // 2.1 (Qt 5.8)
96 /*Q_REVISION(2, 1)*/ void completed();
97 // 2.2 (Qt 5.9)
98 /*Q_REVISION(2, 2)*/ void opened();
99 /*Q_REVISION(2, 2)*/ void closed();
100 /*Q_REVISION(2, 2)*/ void enabledChanged();
101 /*Q_REVISION(2, 2)*/ void transitionChanged();
102
103private:
104 Q_DISABLE_COPY(QQuickSwipe)
105 Q_DECLARE_PRIVATE(QQuickSwipe)
106};
107
108QT_END_NAMESPACE
109
110#endif // QQUICKSWIPE_P_H