summaryrefslogtreecommitdiffstats
path: root/src/declarative/graphicsitems
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2010-03-08 07:17:15 (GMT)
committerMartin Jones <martin.jones@nokia.com>2010-03-08 07:17:15 (GMT)
commit9b06c2dd119f3c4442f7b26756728bb9c7fefb4a (patch)
tree8f02caf1d949a8159a985515435fd1159c0792ac /src/declarative/graphicsitems
parent4d8214afabd5e093c02b0de0e72f24139af6660f (diff)
downloadQt-9b06c2dd119f3c4442f7b26756728bb9c7fefb4a.zip
Qt-9b06c2dd119f3c4442f7b26756728bb9c7fefb4a.tar.gz
Qt-9b06c2dd119f3c4442f7b26756728bb9c7fefb4a.tar.bz2
clearFocus() before setParentItem(0) on an item with focus.
Diffstat (limited to 'src/declarative/graphicsitems')
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
index 55f1c89..6bad4da 100644
--- a/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp
@@ -927,6 +927,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);
}