diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-16 14:54:38 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-11-17 10:25:47 (GMT) |
commit | c535df0f286826c5575ec00c7e4c3f811a73918b (patch) | |
tree | 50d853a85295176a9282a5bffb3184d703571f9a /tests/auto/qgraphicsview/tst_qgraphicsview.cpp | |
parent | db803b363785b6892cbf7809aabba1fb7d5fb934 (diff) | |
download | Qt-c535df0f286826c5575ec00c7e4c3f811a73918b.zip Qt-c535df0f286826c5575ec00c7e4c3f811a73918b.tar.gz Qt-c535df0f286826c5575ec00c7e4c3f811a73918b.tar.bz2 |
Fix tst_QGraphicsView::inputMethodSensitivity autotest
The problem was that the scene was not notified it lost the focus
when it was disconnected from the view (with setScene)
So when it got back the focus, nothing was updated because the
scene thought it still had the focus.
Reviewed-by: jasplin
Diffstat (limited to 'tests/auto/qgraphicsview/tst_qgraphicsview.cpp')
-rw-r--r-- | tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index f07453c..1ff06c2 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3600,6 +3600,7 @@ void tst_QGraphicsView::inputMethodSensitivity() item->setFlag(QGraphicsItem::ItemIsFocusable); scene.addItem(item); scene.setFocusItem(item); + QCOMPARE(scene.focusItem(), item); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); item->setFlag(QGraphicsItem::ItemAcceptsInputMethod, false); @@ -3614,27 +3615,35 @@ void tst_QGraphicsView::inputMethodSensitivity() scene.addItem(item2); scene.setFocusItem(item2); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item2); scene.setFocusItem(item); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); + QCOMPARE(scene.focusItem(), item); view.setScene(0); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item); view.setScene(&scene); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); + QCOMPARE(scene.focusItem(), item); scene.setFocusItem(item2); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item2); view.setScene(0); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item2); scene.setFocusItem(item); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), false); + QCOMPARE(scene.focusItem(), item); view.setScene(&scene); QCOMPARE(view.testAttribute(Qt::WA_InputMethodEnabled), true); + QCOMPARE(scene.focusItem(), item); } class InputContextTester : public QInputContext |