From b44048ae27bd916d0eaa1e7d6a5456488ff76f29 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 1 Mar 2017 13:06:44 +0100 Subject: AbstractButton: add display property This property allows control over how icons and text are displayed within buttons, without having to implement custom delegates. It is also necessary for the upcoming Action type. [ChangeLog][Controls][AbstractButton] Added display property to allow control over how icons and text are displayed within buttons, without having to implement custom delegates. Task-number: QTBUG-49820 Change-Id: Ie924e2c54ed49961fd40129999875c8175606ecd Reviewed-by: J-P Nurmi --- src/quicktemplates2/qquickabstractbutton_p.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/quicktemplates2/qquickabstractbutton_p.h') diff --git a/src/quicktemplates2/qquickabstractbutton_p.h b/src/quicktemplates2/qquickabstractbutton_p.h index 42af6650..e6041e28 100644 --- a/src/quicktemplates2/qquickabstractbutton_p.h +++ b/src/quicktemplates2/qquickabstractbutton_p.h @@ -67,6 +67,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickAbstractButton : public QQuickContr Q_PROPERTY(bool autoExclusive READ autoExclusive WRITE setAutoExclusive NOTIFY autoExclusiveChanged FINAL) Q_PROPERTY(QQuickItem *indicator READ indicator WRITE setIndicator NOTIFY indicatorChanged FINAL) Q_PROPERTY(QQuickIcon *icon READ icon CONSTANT FINAL REVISION 3) + Q_PROPERTY(Display display READ display WRITE setDisplay NOTIFY displayChanged REVISION 3) public: explicit QQuickAbstractButton(QQuickItem *parent = nullptr); @@ -99,6 +100,17 @@ public: QQuickIcon *icon() const; + enum Display { + IconOnly, + TextOnly, + TextBesideIcon, + TextUnderIcon // unused, but reserved for future use + }; + Q_ENUM(Display) + + Display display() const; + void setDisplay(Display display); + public Q_SLOTS: void toggle(); @@ -117,6 +129,7 @@ Q_SIGNALS: void checkableChanged(); void autoExclusiveChanged(); void indicatorChanged(); + Q_REVISION(3) void displayChanged(); protected: QQuickAbstractButton(QQuickAbstractButtonPrivate &dd, QQuickItem *parent); -- cgit v1.2.3