aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2015-03-17 12:08:08 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2015-03-17 13:06:23 +0000
commitb735ba490fa9f43e1d14e356609a85f39e843259 (patch)
treeda27ac8caeee4cacedeee95a473ac95ac2b6cabc /src/quick
parent6dc0ba50bab2fa72978a7b5ee63dae9d66e8ad40 (diff)
parent8d5a2f2a81a001ff64e1a798dc34c61e9ad00b6d (diff)
Merge "Merge remote-tracking branch 'origin/5.4' into 5.5" into refs/staging/5.5
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickitem.cpp5
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)