summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
authorAaron McCarthy <aaron.mccarthy@nokia.com>2010-03-05 03:37:14 (GMT)
committerAaron McCarthy <aaron.mccarthy@nokia.com>2010-03-05 03:37:14 (GMT)
commitc7ac041e5180d118e300a050d9c579467230a48c (patch)
tree396f19b89df7a8da97f459385f4f5ceff58ccede /tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
parent9b7e3943b0e67af48fdbb993c5c4cc93dac81304 (diff)
parenta2e7ab8926c5e8a4c89bb017bbcacfcfbf43ef25 (diff)
downloadQt-c7ac041e5180d118e300a050d9c579467230a48c.zip
Qt-c7ac041e5180d118e300a050d9c579467230a48c.tar.gz
Qt-c7ac041e5180d118e300a050d9c579467230a48c.tar.bz2
Merge remote branch 'staging/4.7' into bearermanagement/polling
Diffstat (limited to 'tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp57
1 files changed, 0 insertions, 57 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 269ec24..7c1b97e 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -438,7 +438,6 @@ private slots:
void QTBUG_6738_missingUpdateWithSetParent();
void QTBUG_7714_fullUpdateDiscardingOpacityUpdate2();
void QT_2653_fullUpdateDiscardingOpacityUpdate();
- void QT_2649_focusScope();
private:
QList<QGraphicsItem *> paintedItems;
@@ -10003,61 +10002,5 @@ void tst_QGraphicsItem::QTBUG_7714_fullUpdateDiscardingOpacityUpdate2()
QTRY_COMPARE(view.repaints, 1);
}
-void tst_QGraphicsItem::QT_2649_focusScope()
-{
- QGraphicsScene *scene = new QGraphicsScene;
-
- QGraphicsRectItem *subFocusItem = new QGraphicsRectItem;
- subFocusItem->setFlags(QGraphicsItem::ItemIsFocusable);
- subFocusItem->setFocus();
- QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem);
-
- QGraphicsRectItem *scope = new QGraphicsRectItem;
- scope->setFlags(QGraphicsItem::ItemIsFocusable | QGraphicsItem::ItemIsFocusScope);
- scope->setFocus();
- subFocusItem->setParentItem(scope);
- QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0);
- QCOMPARE(scope->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem);
-
- QGraphicsRectItem *rootItem = new QGraphicsRectItem;
- rootItem->setFlags(QGraphicsItem::ItemIsFocusable);
- scope->setParentItem(rootItem);
- QCOMPARE(rootItem->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(rootItem->focusScopeItem(), (QGraphicsItem *)0);
- QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0);
- QCOMPARE(scope->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem);
-
- scene->addItem(rootItem);
-
- QEvent windowActivate(QEvent::WindowActivate);
- qApp->sendEvent(scene, &windowActivate);
- scene->setFocus();
-
- QCOMPARE(rootItem->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(scope->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(rootItem->focusScopeItem(), (QGraphicsItem *)0);
- QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0);
- QVERIFY(subFocusItem->hasFocus());
-
- //If we hide the focusScope, the entire subFocus chain should be cleared
- scope->hide();
-
- QCOMPARE(rootItem->focusItem(), (QGraphicsItem *)0);
- QCOMPARE(scope->focusItem(), (QGraphicsItem *)0);
- QCOMPARE(subFocusItem->focusItem(), (QGraphicsItem *)0);
- QCOMPARE(rootItem->focusScopeItem(), (QGraphicsItem *)0);
- QCOMPARE(scope->focusScopeItem(), (QGraphicsItem *)subFocusItem);
- QCOMPARE(subFocusItem->focusScopeItem(), (QGraphicsItem *)0);
- QVERIFY(!subFocusItem->hasFocus());
-
- delete scene;
-}
-
QTEST_MAIN(tst_QGraphicsItem)
#include "tst_qgraphicsitem.moc"