Stabilize tst_QFileDialog2::QTBUG4419_lineEditSelectAll

On macOS the selected text was empty when run together with other tests. Change
QApplication::setActiveWindow() to QWidget::activateWindow() to get keyboard
focus as well. After that the expected temporary file name is selected.

Change-Id: I3b0c2bfca8008cb89b7e666a362beb15a851d8e0
Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
bb10
Kari Oikarinen 2018-05-14 16:23:09 +03:00
parent 8e9fde2bf1
commit d26fd09c6b
1 changed files with 1 additions and 1 deletions

View File

@ -1181,7 +1181,7 @@ void tst_QFileDialog2::QTBUG4419_lineEditSelectAll()
fd.setFileMode(QFileDialog::AnyFile);
fd.show();
QApplication::setActiveWindow(&fd);
fd.activateWindow();
QVERIFY(QTest::qWaitForWindowActive(&fd));
QCOMPARE(fd.isVisible(), true);
QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));