diff options
Diffstat (limited to 'tests/auto/qlineedit/tst_qlineedit.cpp')
-rw-r--r-- | tests/auto/qlineedit/tst_qlineedit.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/auto/qlineedit/tst_qlineedit.cpp b/tests/auto/qlineedit/tst_qlineedit.cpp index 69e7699..ca84b38 100644 --- a/tests/auto/qlineedit/tst_qlineedit.cpp +++ b/tests/auto/qlineedit/tst_qlineedit.cpp @@ -3455,10 +3455,8 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion() completer.setCompletionMode(QCompleter::InlineCompletion); lineEdit.setCompleter(&completer); lineEdit.show(); -#ifdef Q_WS_X11 - // to be safe and avoid failing setFocus with window managers - qt_x11_wait_for_window_manager(&lineEdit); -#endif + QTest::qWaitForWindowShown(&lineEdit); + QApplication::setActiveWindow(&lineEdit); lineEdit.setFocus(); QTRY_VERIFY(lineEdit.hasFocus()); QTest::keyPress(&lineEdit, 'a'); @@ -3651,10 +3649,11 @@ void tst_QLineEdit::taskQTBUG_7395_readOnlyShortcut() le.addAction(&action); le.show(); - QApplication::setActiveWindow(&le); QTest::qWaitForWindowShown(&le); + QApplication::setActiveWindow(&le); le.setFocus(); QTRY_VERIFY(le.hasFocus()); + QTest::keyClick(0, Qt::Key_P); QCOMPARE(spy.count(), 1); } |