diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-01 20:09:44 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-02 14:05:45 +0000 |
commit | ecef73ddb0c6038f6e0208121cfb8786c2cab7f2 (patch) | |
tree | 7d5834b7afdd8eb635e6a301b6d670a3938ee4f2 /src/quicktemplates2/qquickmenu_p.h | |
parent | 1b98cac7c0f7d5515f7bcc6e55e8291eff9e43b7 (diff) |
QQuickMenu: add support for declaring Actions
[ChangeLog][Controls][Menu] Added support for declaring Actions.
The new "delegate" property is used to define a Component that is
used to create menu items that present the actions.
Change-Id: If26f38f6910aa5592879703429a2b418193d5710
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickmenu_p.h')
-rw-r--r-- | src/quicktemplates2/qquickmenu_p.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickmenu_p.h b/src/quicktemplates2/qquickmenu_p.h index 868daaa3..bfb1d605 100644 --- a/src/quicktemplates2/qquickmenu_p.h +++ b/src/quicktemplates2/qquickmenu_p.h @@ -55,6 +55,7 @@ QT_BEGIN_NAMESPACE +class QQmlComponent; class QQuickMenuItem; class QQuickMenuPrivate; @@ -64,6 +65,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenu : public QQuickPopup 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) + Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL REVISION 3) Q_CLASSINFO("DefaultProperty", "contentData") public: @@ -81,6 +83,9 @@ public: QString title() const; void setTitle(QString &title); + QQmlComponent *delegate() const; + void setDelegate(QQmlComponent *delegate); + Q_REVISION(3) Q_INVOKABLE void popup(QQmlV4Function *args); protected: @@ -91,6 +96,7 @@ protected: Q_SIGNALS: void titleChanged(); + Q_REVISION(3) void delegateChanged(); protected: QPalette defaultPalette() const override; |