diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-04-27 13:25:55 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-04-27 11:58:56 +0000 |
commit | 806b1f7c4ed218d4df67428277f06bdbb1c71e0e (patch) | |
tree | 928b66049ac8eb2818014f1d2f5f3e2c2b879799 /src/quicktemplates2/qquickabstractbutton.cpp | |
parent | de6d7e1de7d6b9f6bc45f087c76cb84ac8af1fe0 (diff) |
Use QQml_setParent_noEvent() for QQuickIcon
QObject::setParent() sends QEvent::ChildAdded to the parent. We do
not need such event while creating the grouped icon-property object.
Change-Id: I1ab319f18fd49572eb14de0f7a085567700becfe
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton.cpp')
-rw-r--r-- | src/quicktemplates2/qquickabstractbutton.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp index 9ce26990..96faf2d5 100644 --- a/src/quicktemplates2/qquickabstractbutton.cpp +++ b/src/quicktemplates2/qquickabstractbutton.cpp @@ -640,8 +640,10 @@ void QQuickAbstractButton::setIndicator(QQuickItem *indicator) QQuickIcon *QQuickAbstractButton::icon() const { QQuickAbstractButtonPrivate *d = const_cast<QQuickAbstractButtonPrivate*>(d_func()); - if (!d->icon) - d->icon = new QQuickIcon(const_cast<QQuickAbstractButton*>(this)); + if (!d->icon) { + d->icon = new QQuickIcon; + QQml_setParent_noEvent(d->icon, const_cast<QQuickAbstractButton*>(this)); + } return d->icon; } |