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 | #include <QtQmlModels/private/qtqmlmodelsglobal_p.h> |
21 | |
22 | #include "qquickpopup_p.h" |
23 | #include <QtQuickTemplates2/private/qquickicon_p.h> |
24 | |
25 | QT_REQUIRE_CONFIG(qml_object_model); |
26 | |
27 | QT_BEGIN_NAMESPACE |
28 | |
29 | class QQuickAction; |
30 | class QQmlComponent; |
31 | class ; |
32 | class ; |
33 | |
34 | class Q_QUICKTEMPLATES2_EXPORT : public QQuickPopup |
35 | { |
36 | Q_OBJECT |
37 | Q_PROPERTY(QVariant contentModel READ contentModel CONSTANT FINAL) |
38 | Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL) |
39 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) |
40 | // 2.3 (Qt 5.10) |
41 | Q_PROPERTY(int count READ count NOTIFY countChanged FINAL REVISION(2, 3)) |
42 | Q_PROPERTY(bool cascade READ cascade WRITE setCascade RESET resetCascade NOTIFY cascadeChanged FINAL REVISION(2, 3)) |
43 | Q_PROPERTY(qreal overlap READ overlap WRITE setOverlap NOTIFY overlapChanged FINAL REVISION(2, 3)) |
44 | Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL REVISION(2, 3)) |
45 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL REVISION(2, 3)) |
46 | // 6.5 (Qt 6.5) |
47 | Q_PROPERTY(QQuickIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(6, 5)) |
48 | Q_CLASSINFO("DefaultProperty" , "contentData" ) |
49 | QML_NAMED_ELEMENT(Menu) |
50 | QML_ADDED_IN_VERSION(2, 0) |
51 | |
52 | public: |
53 | explicit (QObject *parent = nullptr); |
54 | (); |
55 | |
56 | Q_INVOKABLE QQuickItem *(int index) const; |
57 | Q_INVOKABLE void (QQuickItem *item); |
58 | Q_INVOKABLE void (int index, QQuickItem *item); |
59 | Q_INVOKABLE void (int from, int to); |
60 | Q_INVOKABLE void (QQuickItem *item); |
61 | |
62 | QVariant () const; |
63 | QQmlListProperty<QObject> (); |
64 | |
65 | QString () const; |
66 | void (const QString &title); |
67 | |
68 | QQuickIcon () const; |
69 | void (const QQuickIcon &icon); |
70 | |
71 | bool () const; |
72 | void (bool cascade); |
73 | void (); |
74 | |
75 | qreal () const; |
76 | void (qreal overlap); |
77 | |
78 | QQmlComponent *() const; |
79 | void (QQmlComponent *delegate); |
80 | |
81 | int () const; |
82 | void (int index); |
83 | |
84 | // 2.3 (Qt 5.10) |
85 | int () const; |
86 | Q_REVISION(2, 3) Q_INVOKABLE QQuickItem *(int index); |
87 | |
88 | Q_REVISION(2, 3) Q_INVOKABLE QQuickMenu *(int index) const; |
89 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickMenu *); |
90 | Q_REVISION(2, 3) Q_INVOKABLE void (int index, QQuickMenu *); |
91 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickMenu *); |
92 | Q_REVISION(2, 3) Q_INVOKABLE QQuickMenu *(int index); |
93 | |
94 | Q_REVISION(2, 3) Q_INVOKABLE QQuickAction *(int index) const; |
95 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickAction *action); |
96 | Q_REVISION(2, 3) Q_INVOKABLE void (int index, QQuickAction *action); |
97 | Q_REVISION(2, 3) Q_INVOKABLE void (QQuickAction *action); |
98 | Q_REVISION(2, 3) Q_INVOKABLE QQuickAction *(int index); |
99 | |
100 | bool () const override; |
101 | void (bool visible) override; |
102 | |
103 | void (QQuickItem * = nullptr); |
104 | void (const QPointF &pos, QQuickItem * = nullptr); |
105 | |
106 | Q_REVISION(2, 3) Q_INVOKABLE void (QQmlV4FunctionPtr args); |
107 | Q_REVISION(2, 3) Q_INVOKABLE void (); |
108 | |
109 | protected: |
110 | void () override; |
111 | void (QQuickItem *newItem, QQuickItem *oldItem) override; |
112 | void (QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override; |
113 | void (QKeyEvent *event) override; |
114 | |
115 | Q_SIGNALS: |
116 | void (const QString &title); |
117 | // 2.3 (Qt 5.10) |
118 | Q_REVISION(2, 3) void (); |
119 | Q_REVISION(2, 3) void (bool cascade); |
120 | Q_REVISION(2, 3) void (); |
121 | Q_REVISION(2, 3) void (); |
122 | Q_REVISION(2, 3) void (); |
123 | // 6.5 (Qt 6.5) |
124 | Q_REVISION(6, 5) void (const QQuickIcon &icon); |
125 | |
126 | protected: |
127 | void (QTimerEvent *event) override; |
128 | |
129 | QFont () const override; |
130 | |
131 | #if QT_CONFIG(accessibility) |
132 | QAccessible::Role () const override; |
133 | #endif |
134 | |
135 | private: |
136 | Q_DISABLE_COPY() |
137 | Q_DECLARE_PRIVATE(QQuickMenu) |
138 | }; |
139 | |
140 | QT_END_NAMESPACE |
141 | |
142 | #endif // QQUICKMENU_P_H |
143 | |