summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2012-02-02 15:29:43 +1000
committerAndrew den Exter <andrew.den-exter@nokia.com>2012-02-02 09:59:40 +0100
commit53e7e93630b3b21a6a05fcdeed4121a6036d0f16 (patch)
tree87ed7ae4a12725b5e99ac9277ed771839f3ccf1c /src/declarative
parenta1344cd4e94179ba4f893117b93266baa39d2a67 (diff)
Fix crash in QDeclarativePathView test.
Ensure items that are scheduled to be deleted later are also parented to either their view or visualdatamodel, so the items are destroyed when the scene or engine if that happens before a DeferredDelete event can be processed. Change-Id: Id336f298067efee86dd32837f595c55b79bc5450 Reviewed-by: Matthew Vogt <matthew.vogt@nokia.com> Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativepathview.cpp b/src/declarative/graphicsitems/qdeclarativepathview.cpp
index e0bc514b..439cf908 100644
--- a/src/declarative/graphicsitems/qdeclarativepathview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativepathview.cpp
@@ -130,6 +130,7 @@ QDeclarativeItem *QDeclarativePathViewPrivate::getItem(int modelIndex)
att->setOnPath(true);
}
item->setParentItem(q);
+ QDeclarative_setParent_noEvent(item, q);
QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
}
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index cd40b689..136e2f75 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -991,6 +991,7 @@ QDeclarativeVisualDataModel::ReleaseFlags QDeclarativeVisualDataModel::release(Q
if (inPackage) {
emit destroyingPackage(qobject_cast<QDeclarativePackage*>(obj));
+ QDeclarative_setParent_noEvent(obj, this);
} else {
if (item->scene())
item->scene()->removeItem(item);