diff options
author | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2016-10-21 11:05:34 +0200 |
---|---|---|
committer | Richard Moe Gustavsen <richard.gustavsen@qt.io> | 2016-10-21 11:34:24 +0000 |
commit | 61e1c61facaf2cd8194cd9db7413c63c56b2362a (patch) | |
tree | cebe3f31a191d8605f2707e56bc7b29e73062334 | |
parent | 16887a0294346edcdf0a912a69e2da892e4fd0e8 (diff) |
qquickwebviewcontroller: don't remove listener from wrong parent
QQuickViewChangeListener::itemParentChanged is called for parent
changes done to any of the items we listen to up the parent chain.
But as it stood, we would always remove the change listener from
m_item->parentItem(), even if the changed item was higher up in
the hierarchy. We would therefore wrongly miss any later changes
done to m_item->parentItem().
A bug from this could be seen when pushing an item containing a
webview to a stackview, since then, several parent changes would
occur.
[ChangeLog][General] Fixed missing geometry update bug when a
webview changed anchestor (e.g. when pushing it onto a StackView).
Task-number: QTBUG-54128
Change-Id: Iff00a0029dd713306db7e39db8c92672a6b379c7
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
-rw-r--r-- | src/webview/qquickviewcontroller.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/webview/qquickviewcontroller.cpp b/src/webview/qquickviewcontroller.cpp index ab9e254..56b169b 100644 --- a/src/webview/qquickviewcontroller.cpp +++ b/src/webview/qquickviewcontroller.cpp @@ -109,9 +109,9 @@ void QQuickViewChangeListener::itemChildRemoved(QQuickItem *item, QQuickItem *ch removeAncestorListeners(item, changeMask); } -void QQuickViewChangeListener::itemParentChanged(QQuickItem * /*item*/, QQuickItem *newParent) +void QQuickViewChangeListener::itemParentChanged(QQuickItem *item, QQuickItem *newParent) { - removeAncestorListeners(m_item->parentItem(), changeMask); + removeAncestorListeners(item->parentItem(), changeMask); // Adds this as a listener for newParent and its ancestors. addAncestorListeners(newParent, changeMask); } |