summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2010-08-10 01:50:49 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2010-08-10 01:50:49 (GMT)
commit6feb5b75ce96aeeefee189af003949db8c031519 (patch)
tree1d079b5ed48007f3dff4a4ffaced61eed83d9012 /src/declarative/graphicsitems
parent27b5da4ff5a762df0ab3e98ecde9dac4aa589178 (diff)
downloadQt-6feb5b75ce96aeeefee189af003949db8c031519.zip
Qt-6feb5b75ce96aeeefee189af003949db8c031519.tar.gz
Qt-6feb5b75ce96aeeefee189af003949db8c031519.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
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativeitem.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativeitem.cpp b/src/declarative/graphicsitems/qdeclarativeitem.cpp
index ff05997..9d782b9 100644
--- a/src/declarative/graphicsitems/qdeclarativeitem.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeitem.cpp
@@ -2724,12 +2724,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;