summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp')
-rw-r--r--tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
index 79dd2bdd7d..2d629176f3 100644
--- a/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
+++ b/tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp
@@ -10411,10 +10411,8 @@ void tst_QGraphicsItem::updateMicroFocus()
QGraphicsView view2(&scene);
layout.addWidget(&view, 0, 0);
layout.addWidget(&view2, 0, 1);
- MyInputContext ic2;
- view2.setInputContext(&ic2);
- MyInputContext ic;
- view.setInputContext(&ic);
+ MyInputContext *ic = new MyInputContext;
+ qApp->setInputContext(ic);
MyInputWidget input;
input.setPos(0, 0);
input.resize(150, 150);
@@ -10427,13 +10425,10 @@ void tst_QGraphicsItem::updateMicroFocus()
QTest::qWaitForWindowShown(&parent);
QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&parent));
//We reset the number of updates that happened previously (initialisation)
- ic.nbUpdates = 0;
- ic2.nbUpdates = 0;
+ ic->nbUpdates = 0;
input.doUpdateMicroFocus();
QApplication::processEvents();
- QTRY_COMPARE(ic.nbUpdates, 1);
- //No update since view2 does not have the focus.
- QTRY_COMPARE(ic2.nbUpdates, 0);
+ QTRY_COMPARE(ic->nbUpdates, 1);
}
void tst_QGraphicsItem::textItem_shortcuts()