diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-03-17 09:48:35 +0100 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2015-03-17 09:48:36 +0100 |
commit | 8d5a2f2a81a001ff64e1a798dc34c61e9ad00b6d (patch) | |
tree | 22c73b798dc55c47a6b3524eb79aed85716abf59 /src/quick/items/qquickitem.cpp | |
parent | 84155a8e1a6250d3e4b0949a42464eee5dfef537 (diff) | |
parent | dec6b8a8d294bc6193f680c5b5038dc12b6ae17c (diff) |
Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: I4c338a44c1d64c2d8e637971ab3ec6982c40a685
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 68ea5f4dbf..776da86b7e 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -2518,13 +2518,12 @@ void QQuickItem::setParentItem(QQuickItem *parentItem) QQuickWindowPrivate::get(d->window)->parentlessItems.remove(this); } - QQuickWindow *oldParentWindow = oldParentItem ? QQuickItemPrivate::get(oldParentItem)->window : 0; QQuickWindow *parentWindow = parentItem ? QQuickItemPrivate::get(parentItem)->window : 0; - if (oldParentWindow == parentWindow) { + if (d->window == parentWindow) { // Avoid freeing and reallocating resources if the window stays the same. d->parentItem = parentItem; } else { - if (oldParentWindow) + if (d->window) d->derefWindow(); d->parentItem = parentItem; if (parentWindow) |