summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem
diff options
context:
space:
mode:
authorAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-09-22 09:23:48 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-09-22 14:13:41 (GMT)
commitf16fd9324ae5f86dfe851cad9639d2ee2e8571ed (patch)
tree9fa4338699f7d7747e4a7f9de9ea49a3b6606905 /tests/auto/qgraphicsitem
parent04b7a414f626795b8000271e133b65f8b72ea4c9 (diff)
downloadQt-f16fd9324ae5f86dfe851cad9639d2ee2e8571ed.zip
Qt-f16fd9324ae5f86dfe851cad9639d2ee2e8571ed.tar.gz
Qt-f16fd9324ae5f86dfe851cad9639d2ee2e8571ed.tar.bz2
Fix focus scope bugs, verified against examples in kinetic-declarativeui.
The C++ autotests have been updated to match the expected behavior of the examples that broke (e.g., listview.qml) in kinetic-declarativeui. Reviewed-by: Alexis
Diffstat (limited to 'tests/auto/qgraphicsitem')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 9b8ce1f..6f37b70 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -8299,7 +8299,7 @@ void tst_QGraphicsItem::focusScope()
QVERIFY(!scope2->focusScopeItem());
scope3->setParentItem(scope2);
QCOMPARE(scope2->focusScopeItem(), (QGraphicsItem *)scope3);
- QCOMPARE(scope2->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope2->focusItem(), (QGraphicsItem *)scope2);
QGraphicsRectItem *scope1 = new QGraphicsRectItem;
scope1->setData(0, "scope1");
@@ -8308,9 +8308,9 @@ void tst_QGraphicsItem::focusScope()
QVERIFY(!scope1->focusScopeItem());
scope2->setParentItem(scope1);
- QCOMPARE(scope1->focusItem(), (QGraphicsItem *)scope3);
- QCOMPARE(scope2->focusItem(), (QGraphicsItem *)scope3);
- QCOMPARE(scope3->focusItem(), (QGraphicsItem *)scope3);
+ QCOMPARE(scope1->focusItem(), (QGraphicsItem *)scope1);
+ QCOMPARE(scope2->focusItem(), (QGraphicsItem *)0);
+ QCOMPARE(scope3->focusItem(), (QGraphicsItem *)0);
QCOMPARE(scope1->focusScopeItem(), (QGraphicsItem *)scope2);
QCOMPARE(scope2->focusScopeItem(), (QGraphicsItem *)scope3);
QCOMPARE(scope3->focusScopeItem(), (QGraphicsItem *)0);
@@ -8361,11 +8361,11 @@ void tst_QGraphicsItem::focusScope()
rect5->setFocus();
rect5->setParentItem(rect4);
QCOMPARE(scope3->focusScopeItem(), (QGraphicsItem *)rect5);
- QVERIFY(rect5->hasFocus());
+ QVERIFY(!rect5->hasFocus());
rect4->setParentItem(0);
QCOMPARE(scope3->focusScopeItem(), (QGraphicsItem *)0);
- QVERIFY(!scope3->hasFocus());
+ QVERIFY(scope3->hasFocus());
QGraphicsRectItem *rectA = new QGraphicsRectItem;
QGraphicsRectItem *scopeA = new QGraphicsRectItem(rectA);
@@ -8376,7 +8376,7 @@ void tst_QGraphicsItem::focusScope()
scopeB->setFocus();
scene.addItem(rectA);
- QVERIFY(rect5->hasFocus());
+ QVERIFY(!rect5->hasFocus());
QVERIFY(!scopeB->hasFocus());
scopeA->setFocus();