aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickmenu_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2017-11-06 14:18:12 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2017-11-06 14:15:04 +0000
commit8a56c3322f72d0ec1d55c3bfb679355919f27e34 (patch)
tree0ee4e2976af445207cde9e1743eadc4074abc31e /src/quicktemplates2/qquickmenu_p.h
parentc39b126a77e27296ef82a1634753c775cc5a93fb (diff)
Re-order revision 3 members and add explanatory comments
We've come to realize that even though it's tempting to group similar properties together, organizing the API so that revisions are grouped together makes future maintenance more pleasant. It's a lot easier to to see what was added and when. The same was done for earlier revisions in 5.9 in commit 430fe83. Change-Id: I738d7fdadd348c21737228c37d0f31e39b37f8e7 Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickmenu_p.h')
-rw-r--r--src/quicktemplates2/qquickmenu_p.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/src/quicktemplates2/qquickmenu_p.h b/src/quicktemplates2/qquickmenu_p.h
index 80c4c055..01b970f8 100644
--- a/src/quicktemplates2/qquickmenu_p.h
+++ b/src/quicktemplates2/qquickmenu_p.h
@@ -63,10 +63,11 @@ class QQuickMenuPrivate;
class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenu : public QQuickPopup
{
Q_OBJECT
- Q_PROPERTY(int count READ count NOTIFY countChanged FINAL REVISION 3)
Q_PROPERTY(QVariant contentModel READ contentModel CONSTANT FINAL)
Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL)
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL)
+ // 2.3 (Qt 5.10)
+ Q_PROPERTY(int count READ count NOTIFY countChanged FINAL REVISION 3)
Q_PROPERTY(bool cascade READ cascade WRITE setCascade RESET resetCascade NOTIFY cascadeChanged FINAL REVISION 3)
Q_PROPERTY(qreal overlap READ overlap WRITE setOverlap NOTIFY overlapChanged FINAL REVISION 3)
Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL REVISION 3)
@@ -76,26 +77,12 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenu : public QQuickPopup
public:
explicit QQuickMenu(QObject *parent = nullptr);
- int count() const;
Q_INVOKABLE QQuickItem *itemAt(int index) const;
Q_INVOKABLE void addItem(QQuickItem *item);
Q_INVOKABLE void insertItem(int index, QQuickItem *item);
Q_INVOKABLE void moveItem(int from, int to);
Q_INVOKABLE void removeItem(const QVariant &item); // ### Qt 6: remove
void removeItem(QQuickItem *item); // ### Qt 6: Q_INVOKABLE
- Q_REVISION(3) Q_INVOKABLE QQuickItem *takeItem(int index);
-
- Q_REVISION(3) Q_INVOKABLE QQuickMenu *menuAt(int index) const;
- Q_REVISION(3) Q_INVOKABLE void addMenu(QQuickMenu *menu);
- Q_REVISION(3) Q_INVOKABLE void insertMenu(int index, QQuickMenu *menu);
- Q_REVISION(3) Q_INVOKABLE void removeMenu(QQuickMenu *menu);
- Q_REVISION(3) Q_INVOKABLE QQuickMenu *takeMenu(int index);
-
- Q_REVISION(3) Q_INVOKABLE QQuickAction *actionAt(int index) const;
- Q_REVISION(3) Q_INVOKABLE void addAction(QQuickAction *action);
- Q_REVISION(3) Q_INVOKABLE void insertAction(int index, QQuickAction *action);
- Q_REVISION(3) Q_INVOKABLE void removeAction(QQuickAction *action);
- Q_REVISION(3) Q_INVOKABLE QQuickAction *takeAction(int index);
QVariant contentModel() const;
QQmlListProperty<QObject> contentData();
@@ -116,6 +103,22 @@ public:
int currentIndex() const;
void setCurrentIndex(int index);
+ // 2.3 (Qt 5.10)
+ int count() const;
+ Q_REVISION(3) Q_INVOKABLE QQuickItem *takeItem(int index);
+
+ Q_REVISION(3) Q_INVOKABLE QQuickMenu *menuAt(int index) const;
+ Q_REVISION(3) Q_INVOKABLE void addMenu(QQuickMenu *menu);
+ Q_REVISION(3) Q_INVOKABLE void insertMenu(int index, QQuickMenu *menu);
+ Q_REVISION(3) Q_INVOKABLE void removeMenu(QQuickMenu *menu);
+ Q_REVISION(3) Q_INVOKABLE QQuickMenu *takeMenu(int index);
+
+ Q_REVISION(3) Q_INVOKABLE QQuickAction *actionAt(int index) const;
+ Q_REVISION(3) Q_INVOKABLE void addAction(QQuickAction *action);
+ Q_REVISION(3) Q_INVOKABLE void insertAction(int index, QQuickAction *action);
+ Q_REVISION(3) Q_INVOKABLE void removeAction(QQuickAction *action);
+ Q_REVISION(3) Q_INVOKABLE QQuickAction *takeAction(int index);
+
void popup(QQuickItem *menuItem = nullptr);
void popup(const QPointF &pos, QQuickItem *menuItem = nullptr);
@@ -129,8 +132,9 @@ protected:
void keyPressEvent(QKeyEvent *event) override;
Q_SIGNALS:
- Q_REVISION(3) void countChanged();
void titleChanged(const QString &title);
+ // 2.3 (Qt 5.10)
+ Q_REVISION(3) void countChanged();
Q_REVISION(3) void cascadeChanged(bool cascade);
Q_REVISION(3) void overlapChanged();
Q_REVISION(3) void delegateChanged();