diff options
author | Martin Jones <martin.jones@nokia.com> | 2009-12-15 22:22:16 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2009-12-15 22:22:16 (GMT) |
commit | 889b15f62121fd79b28b9f903569fc101578a139 (patch) | |
tree | e428adfeaa373673aa6557da6ede7ac56b63a800 /src/declarative/graphicsitems/qmlgraphicspositioners.cpp | |
parent | 1e234c557ddbe5787b537f14ca383bd16e4e4cd1 (diff) | |
download | Qt-889b15f62121fd79b28b9f903569fc101578a139.zip Qt-889b15f62121fd79b28b9f903569fc101578a139.tar.gz Qt-889b15f62121fd79b28b9f903569fc101578a139.tar.bz2 |
Watch item geometry changes without using signal/slot connections.
Diffstat (limited to 'src/declarative/graphicsitems/qmlgraphicspositioners.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qmlgraphicspositioners.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp index b96b8b8..ecaab80 100644 --- a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp +++ b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp @@ -67,8 +67,7 @@ void QmlGraphicsBasePositionerPrivate::watchChanges(QmlGraphicsItem *other) QmlGraphicsItemPrivate *otherPrivate = static_cast<QmlGraphicsItemPrivate*>(QGraphicsItemPrivate::get(other)); - otherPrivate->connectToHeightChanged(q, prePosIdx); - otherPrivate->connectToWidthChanged(q, prePosIdx); + otherPrivate->addGeometryListener(this); otherPrivate->registerSiblingOrderNotification(this); watched << other; @@ -81,8 +80,8 @@ void QmlGraphicsBasePositionerPrivate::unwatchChanges(QmlGraphicsItem* other) bool stillAlive = false; //Use the returns from disconnect to see if it was deleted or just reparented stillAlive |= QMetaObject::disconnect(other, visibleIdx, q, prePosIdx); stillAlive |= QMetaObject::disconnect(other, opacityIdx, q, prePosIdx); - stillAlive |= otherPrivate->disconnectFromHeightChanged(q, prePosIdx); - stillAlive |= otherPrivate->disconnectFromWidthChanged(q, prePosIdx); + + otherPrivate->removeGeometryListener(this); if(stillAlive) otherPrivate->unregisterSiblingOrderNotification(this); |