summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-13 00:37:41 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-13 00:37:41 (GMT)
commite0a137cd1b138e63804756f897a20bf8178efb84 (patch)
treeaf495868d66869eeac6e6dc5868d514539cfb2d7 /src/declarative/graphicsitems
parentabb70694334a770d4acb0ec607bb9b02defd1204 (diff)
parent1e09535438b5dc7d2961b9bb22340a86a80f8856 (diff)
downloadQt-e0a137cd1b138e63804756f897a20bf8178efb84.zip
Qt-e0a137cd1b138e63804756f897a20bf8178efb84.tar.gz
Qt-e0a137cd1b138e63804756f897a20bf8178efb84.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspositioners.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp
index ced9d55..65e63eb 100644
--- a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp
@@ -70,15 +70,18 @@ void QmlGraphicsBasePositionerPrivate::watchChanges(QmlGraphicsItem *other)
void QmlGraphicsBasePositionerPrivate::unwatchChanges(QmlGraphicsItem* other)
{
Q_Q(QmlGraphicsBasePositioner);
- QObject::disconnect(other, SIGNAL(visibleChanged()),
+ bool stillAlive = false; //Use the return from disconnect to see if it was deleted or just reparented
+ stillAlive |= QObject::disconnect(other, SIGNAL(visibleChanged()),
q, SLOT(prePositioning()));
- QObject::disconnect(other, SIGNAL(opacityChanged()),
+ stillAlive |= QObject::disconnect(other, SIGNAL(opacityChanged()),
q, SLOT(prePositioning()));
- QObject::disconnect(other, SIGNAL(heightChanged()),
+ stillAlive |= QObject::disconnect(other, SIGNAL(heightChanged()),
q, SLOT(prePositioning()));
- QObject::disconnect(other, SIGNAL(widthChanged()),
+ stillAlive |= QObject::disconnect(other, SIGNAL(widthChanged()),
q, SLOT(prePositioning()));
- static_cast<QmlGraphicsItemPrivate*>(QGraphicsItemPrivate::get(other))->unregisterSiblingOrderNotification(this);
+ if(stillAlive)
+ static_cast<QmlGraphicsItemPrivate*>(QGraphicsItemPrivate::get(other))
+ ->unregisterSiblingOrderNotification(this);
watched.removeAll(other);
}
@@ -266,18 +269,9 @@ void QmlGraphicsBasePositioner::prePositioning()
positionedItems << child;
}
QSet<QmlGraphicsItem *> deletedItems = d->_items - allItems;
- foreach(QmlGraphicsItem *child, d->_items){
- if (!allItems.contains(child)){
- if (!deletedItems.contains(child)) {
- QObject::disconnect(child, SIGNAL(opacityChanged()),
- this, SLOT(prePositioning()));
- QObject::disconnect(child, SIGNAL(heightChanged()),
- this, SLOT(prePositioning()));
- QObject::disconnect(child, SIGNAL(widthChanged()),
- this, SLOT(prePositioning()));
- }
- d->_items -= child;
- }
+ foreach(QmlGraphicsItem *child, deletedItems){
+ d->unwatchChanges(child);
+ d->_items -= child;
}
d->_animated.clear();
doPositioning();