summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-09-11 07:18:49 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-09-15 09:31:02 (GMT)
commit9b579d7821205250b8d64b06a19d5e4fccd56f31 (patch)
tree1efec81be26a73c23628c8b814bc2ff0ab435804
parent708d3c9e9470a84bce48b26cf747d561a5a4c985 (diff)
downloadQt-9b579d7821205250b8d64b06a19d5e4fccd56f31.zip
Qt-9b579d7821205250b8d64b06a19d5e4fccd56f31.tar.gz
Qt-9b579d7821205250b8d64b06a19d5e4fccd56f31.tar.bz2
Remove this line; which no longer has any effect.
This line was added to fix crashes when deleting items that had a subFocusItem pointing to a child that was already deleted. This bug was fixed by ebb1162f54a29baeccb71d1e283146892629518f. After this, subFocusItem is always 0 at this point. The original change was eb3d5a73148cd7206c6b3b6672ed47b44611f745. Reviewed-by: TrustMe
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp2
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp5
2 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/graphicsview/qgraphicsitem.cpp b/src/gui/graphicsview/qgraphicsitem.cpp
index 5d11ec3..9295ee5 100644
--- a/src/gui/graphicsview/qgraphicsitem.cpp
+++ b/src/gui/graphicsview/qgraphicsitem.cpp
@@ -1205,8 +1205,6 @@ QGraphicsItem::~QGraphicsItem()
Q_ASSERT(d_ptr->children.isEmpty());
}
- d_ptr->subFocusItem = 0;
-
if (d_ptr->scene) {
d_ptr->scene->d_func()->removeItemHelper(this);
} else {
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 96580f6..6b5e4bb 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -7666,6 +7666,11 @@ void tst_QGraphicsItem::subFocus()
QVERIFY(!rect->hasFocus());
QVERIFY(!rect2->hasFocus());
QVERIFY(rect3->hasFocus());
+
+ delete rect2;
+ QCOMPARE(text->focusItem(), (QGraphicsItem *)0);
+ QCOMPARE(text2->focusItem(), (QGraphicsItem *)0);
+ QCOMPARE(rect->focusItem(), (QGraphicsItem *)0);
}
void tst_QGraphicsItem::focusProxyDeletion()