diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2010-08-10 01:50:49 (GMT) |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-08-11 05:08:46 (GMT) |
commit | e0167ee787bd0d28a9de0278c3f70f30151e2be6 (patch) | |
tree | 7f6036cc44c50e113e898f3b12635f1a17849cfe /src | |
parent | e133941d76a2214708b5d7c6aa35eae44d6f5076 (diff) | |
download | Qt-e0167ee787bd0d28a9de0278c3f70f30151e2be6.zip Qt-e0167ee787bd0d28a9de0278c3f70f30151e2be6.tar.gz Qt-e0167ee787bd0d28a9de0278c3f70f30151e2be6.tar.bz2 |
Don't double-add item change listeners.
When a Repeater was used as the child of an Item binding to childrenRect,
the item change listener was being added twice for the items created
by the Repeater.
Task-number: QTBUG-12722
(cherry picked from commit 6feb5b75ce96aeeefee189af003949db8c031519)
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativeitem.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp index 06862f1..ccbdce8 100644 --- a/src/declarative/graphicsitems/qdeclarativeitem.cpp +++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp @@ -2740,12 +2740,12 @@ QVariant QDeclarativeItem::itemChange(GraphicsItemChange change, } break; case ItemChildAddedChange: - if (d->_contents) + if (d->_contents && d->componentComplete) d->_contents->childAdded(qobject_cast<QDeclarativeItem*>( value.value<QGraphicsItem*>())); break; case ItemChildRemovedChange: - if (d->_contents) + if (d->_contents && d->componentComplete) d->_contents->childRemoved(qobject_cast<QDeclarativeItem*>( value.value<QGraphicsItem*>())); break; |