aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qquickitem.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2011-11-30 16:03:10 +1000
committerQt by Nokia <qt-info@nokia.com>2011-12-01 02:40:06 +0100
commitf304dd6fbb9d901c0a72609dc3c384eab4935f93 (patch)
tree2cf4f18b3c80a28c8ac273b21637e89c331d80cd /src/declarative/items/qquickitem.cpp
parent446547e8de1110148f214defa8584d847056388e (diff)
Don't update dependent anchors on destruction unless required.
Change-Id: Ic088e800d5bbad0a819824a21b4c0bf430126786 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative/items/qquickitem.cpp')
-rw-r--r--src/declarative/items/qquickitem.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/items/qquickitem.cpp b/src/declarative/items/qquickitem.cpp
index 161404f938..9c11196944 100644
--- a/src/declarative/items/qquickitem.cpp
+++ b/src/declarative/items/qquickitem.cpp
@@ -1755,10 +1755,13 @@ QQuickItem::~QQuickItem()
anchor->clearItem(this);
}
- // XXX todo - the original checks if the parent is being destroyed
+ /*
+ update item anchors that depended on us unless they are our child (and will also be destroyed),
+ or our sibling, and our parent is also being destroyed.
+ */
for (int ii = 0; ii < d->changeListeners.count(); ++ii) {
QQuickAnchorsPrivate *anchor = d->changeListeners.at(ii).listener->anchorPrivate();
- if (anchor && anchor->item && anchor->item->parent() != this) //child will be deleted anyway
+ if (anchor && anchor->item && anchor->item->parentItem() && anchor->item->parentItem() != this)
anchor->update();
}