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 | |
4 | #ifndef QQUICKMENU_P_H |
5 | #define |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtQml/qqmllist.h> |
19 | #include <QtQml/qqml.h> |
20 | |
21 | #include "qquickpopup_p.h" |
22 | #include <QtQuickTemplates2/private/qquickicon_p.h> |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | class QQuickAction; |
27 | class QQmlComponent; |
28 | class ; |
29 | class ; |
30 | |
31 | class Q_QUICKTEMPLATES2_PRIVATE_EXPORT : public QQuickPopup |
32 | { |
33 | Q_OBJECT |
34 | Q_PROPERTY(QVariant contentModel READ contentModel CONSTANT FINAL) |
35 | Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL) |
36 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) |
37 | // 2.3 (Qt 5.10) |
38 | Q_PROPERTY(int count READ count NOTIFY countChanged FINAL REVISION(2, 3)) |
39 | Q_PROPERTY(bool cascade READ cascade WRITE setCascade RESET resetCascade NOTIFY cascadeChanged FINAL REVISION(2, 3)) |
40 | Q_PROPERTY(qreal overlap READ overlap WRITE setOverlap NOTIFY overlapChanged FINAL REVISION(2, 3)) |
41 | Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL REVISION(2, 3)) |
42 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL REVISION(2, 3)) |
43 | // 6.5 (Qt 6.5) |
44 | Q_PROPERTY(QQuickIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(6, 5)) |
45 | Q_CLASSINFO("DefaultProperty" , "contentData" ) |
46 | QML_NAMED_ELEMENT(Menu) |
47 | QML_ADDED_IN_VERSION(2, 0) |
48 | |
49 | public: |
50 | explicit (QObject *parent = nullptr); |
51 | (); |
52 | |
53 | Q_INVOKABLE QQuickItem *(int index) const; |
54 | Q_INVOKABLE void (QQuickItem *item); |
55 | Q_INVOKABLE void (int index, QQuickItem *item); |
56 | Q_INVOKABLE void (int from, int to); |
57 | Q_INVOKABLE void (QQuickItem *item); |
58 | |
59 | QVariant () const; |
60 | QQmlListProperty<QObject> (); |
61 | |
62 | QString () const; |
63 | void (QString &title); |
64 | |
65 | QQuickIcon () const; |
66 | void (const QQuickIcon &icon); |
67 | |
68 | bool () const; |
69 | void (bool cascade); |
70 | void (); |
71 | |
72 | qreal () const; |
73 | void (qreal overlap); |
74 | |
75 | QQmlComponent *() const; |
76 | void (QQmlComponent *delegate); |
77 | |
78 | int () const; |
79 | void (int index); |
80 | |
81 | // 2.3 (Qt 5.10) |
82 | int () const; |
83 | Q_REVISION(2, 3) Q_INVOKABLE QQuickItem *(int index); |
84 | |
85 | Q_REVISION(2, 3) Q_INVOKABLE QQuickMenu *(int index) const; |
86 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickMenu *); |
87 | Q_REVISION(2, 3) Q_INVOKABLE void (int index, QQuickMenu *); |
88 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickMenu *); |
89 | Q_REVISION(2, 3) Q_INVOKABLE QQuickMenu *(int index); |
90 | |
91 | Q_REVISION(2, 3) Q_INVOKABLE QQuickAction *(int index) const; |
92 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickAction *action); |
93 | Q_REVISION(2, 3) Q_INVOKABLE void (int index, QQuickAction *action); |
94 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickAction *action); |
95 | Q_REVISION(2, 3) Q_INVOKABLE QQuickAction *(int index); |
96 | |
97 | void (QQuickItem * = nullptr); |
98 | void (const QPointF &pos, QQuickItem * = nullptr); |
99 | |
100 | Q_REVISION(2, 3) Q_INVOKABLE void (QQmlV4Function *args); |
101 | Q_REVISION(2, 3) Q_INVOKABLE void (); |
102 | |
103 | protected: |
104 | void () override; |
105 | void (QQuickItem *newItem, QQuickItem *oldItem) override; |
106 | void (QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override; |
107 | void (QKeyEvent *event) override; |
108 | |
109 | Q_SIGNALS: |
110 | void (const QString &title); |
111 | // 2.3 (Qt 5.10) |
112 | Q_REVISION(2, 3) void (); |
113 | Q_REVISION(2, 3) void (bool cascade); |
114 | Q_REVISION(2, 3) void (); |
115 | Q_REVISION(2, 3) void (); |
116 | Q_REVISION(2, 3) void (); |
117 | // 6.5 (Qt 6.5) |
118 | Q_REVISION(6, 5) void (const QQuickIcon &icon); |
119 | |
120 | protected: |
121 | void (QTimerEvent *event) override; |
122 | |
123 | QFont () const override; |
124 | |
125 | #if QT_CONFIG(accessibility) |
126 | QAccessible::Role () const override; |
127 | #endif |
128 | |
129 | private: |
130 | Q_DISABLE_COPY() |
131 | Q_DECLARE_PRIVATE(QQuickMenu) |
132 | }; |
133 | |
134 | QT_END_NAMESPACE |
135 | |
136 | QML_DECLARE_TYPE(QQuickMenu) |
137 | |
138 | #endif // QQUICKMENU_P_H |
139 | |