summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-04-30 06:13:07 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-04-30 06:13:07 (GMT)
commit7b9d8b6b98378cb69b4276f4bc49331556a394c0 (patch)
treec8a1eed81a856d3edcf60526cbe469019c6d860d /src/declarative/graphicsitems
parent1b39890940ce8ea4298a1af16ba220f65f365e7e (diff)
downloadQt-7b9d8b6b98378cb69b4276f4bc49331556a394c0.zip
Qt-7b9d8b6b98378cb69b4276f4bc49331556a394c0.tar.gz
Qt-7b9d8b6b98378cb69b4276f4bc49331556a394c0.tar.bz2
When a model delegate is released, remove it from the scene immediately.
Task-number: QTBUG-10289
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 43cafe3..2addc77 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -55,6 +55,7 @@
#include <qdeclarativeguard_p.h>
#include <qdeclarativeglobal_p.h>
+#include <qgraphicsscene.h>
#include <qlistmodelinterface_p.h>
#include <qhash.h>
#include <qlist.h>
@@ -966,10 +967,8 @@ QDeclarativeVisualDataModel::ReleaseFlags QDeclarativeVisualDataModel::release(Q
if (inPackage) {
emit destroyingPackage(qobject_cast<QDeclarativePackage*>(obj));
} else {
- if (item->hasFocus())
- item->clearFocus();
- item->setOpacity(0.0);
- static_cast<QGraphicsItem*>(item)->setParentItem(0);
+ if (item->scene())
+ item->scene()->removeItem(item);
}
stat |= Destroyed;
obj->deleteLater();