diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-05-09 16:44:08 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-05-10 16:19:57 +0000 |
commit | 6c2a24a4f2695ae5565b9a5a42b04c9b68833866 (patch) | |
tree | 5373f36a6d5c54ce6c2caf386113142ed5e9fa89 /src/quicktemplates2/qquickabstractbutton_p.h | |
parent | 9947c815ea54c781bc1a9c95e26e2af1e6eebb87 (diff) |
Make QQuickIcon a value type
QQuickIcon no longer inherits QObject, but becomes a light-weight
implicitly shared Q_GADGET-type, that is passed by value the same
way fonts and colors are.
Before:
SUB: OS: Fedora 25 (Workstation Edition)
SUB: QPA: xcb
SUB: GL_VENDOR: Intel Open Source Technology Center
SUB: GL_RENDERER: Mesa DRI Intel(R) Haswell Desktop
SUB: GL_VERSION: 3.0 Mesa 13.0.4
SUB: running: benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml
SUB: 110 frames
SUB: 109 frames
SUB: 109 frames
SUB: 109 frames
SUB: 109 frames
SUB: Average:
SUB: 109.2 frames; using samples; MedianAll=109; StdDev=0.447214, CoV=0.00409536
After:
[...]
SUB: running: benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml
SUB: 123 frames
SUB: 124 frames
SUB: 124 frames
SUB: 122 frames
SUB: 125 frames
SUB: Average:
SUB: 123.6 frames; using samples; MedianAll=124; StdDev=1.14018, CoV=0.00922472
Change-Id: I604532204fb94fc0726d0c9b8b6097f9ebc265e8
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton_p.h')
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton_p.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton_p.h b/src/quicktemplates2/qquickabstractbutton_p.h index c6a50665..9c372414 100644 --- a/src/quicktemplates2/qquickabstractbutton_p.h +++ b/src/quicktemplates2/qquickabstractbutton_p.h @@ -49,10 +49,10 @@ // #include <QtQuickTemplates2/private/qquickcontrol_p.h> +#include <QtQuickTemplates2/private/qquickicon_p.h> QT_BEGIN_NAMESPACE -class QQuickIcon; class QQuickAction; class QQuickAbstractButtonPrivate; @@ -66,7 +66,7 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickAbstractButton : public QQuickContr Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged FINAL) 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(QQuickIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 3) Q_PROPERTY(Display display READ display WRITE setDisplay NOTIFY displayChanged REVISION 3) Q_PROPERTY(QQuickAction *action READ action WRITE setAction NOTIFY actionChanged FINAL REVISION 3) @@ -99,7 +99,8 @@ public: QQuickItem *indicator() const; void setIndicator(QQuickItem *indicator); - QQuickIcon *icon() const; + QQuickIcon icon() const; + void setIcon(const QQuickIcon &icon); enum Display { IconOnly, @@ -133,6 +134,7 @@ Q_SIGNALS: void checkableChanged(); void autoExclusiveChanged(); void indicatorChanged(); + Q_REVISION(3) void iconChanged(); Q_REVISION(3) void displayChanged(); Q_REVISION(3) void actionChanged(); |