{
TestRejectDialog dialog;
dialog.show();
- QTest::qWaitForWindowShown(&dialog);
- QTRY_VERIFY(dialog.isVisible());
+ QVERIFY(QTest::qWaitForWindowExposed(&dialog));
+ QVERIFY(dialog.isVisible());
dialog.reject();
QTRY_VERIFY(!dialog.isVisible());
QCOMPARE(dialog.called, 1);
dialog.show();
- QTest::qWaitForWindowShown(&dialog);
- QTRY_VERIFY(dialog.isVisible());
+ QVERIFY(QTest::qWaitForWindowExposed(&dialog));
+ QVERIFY(dialog.isVisible());
QVERIFY(dialog.close());
QTRY_VERIFY(!dialog.isVisible());
QCOMPARE(dialog.called, 2);
dialog.cancelReject = true;
dialog.show();
- QTest::qWaitForWindowShown(&dialog);
- QTRY_VERIFY(dialog.isVisible());
+ QVERIFY(QTest::qWaitForWindowExposed(&dialog));
+ QVERIFY(dialog.isVisible());
dialog.reject();
QTRY_VERIFY(dialog.isVisible());
QCOMPARE(dialog.called, 3);
QSignalSpy spyFilesSelected(&fd, SIGNAL(filesSelected(const QStringList &)));
fd.show();
- QTest::qWait(500);
+ QVERIFY(QTest::qWaitForWindowExposed(&fd));
QListView *listView = qFindChild<QListView*>(&fd, "listView");
QVERIFY(listView);
QString temporary = QDir::tempPath() + QLatin1String("/blah");
dialog->selectFile(temporary);
dialog->show();
- QTest::qWait(500);
+ QVERIFY(QTest::qWaitForWindowExposed(dialog));
QLineEdit *lineEdit = qFindChild<QLineEdit*>(dialog, "fileNameEdit");
QVERIFY(lineEdit);
QCOMPARE(lineEdit->text(),QLatin1String("blah"));
fd.setDirectory(QDir::currentPath());
fd.show();
QApplication::setActiveWindow(&fd);
- QTest::qWaitForWindowShown(&fd);
- QTRY_COMPARE(fd.isVisible(), true);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+ QVERIFY(QTest::qWaitForWindowActive(&fd));
+ QCOMPARE(fd.isVisible(), true);
+ QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
qApp->processEvents();
// make sure the tests work with focus follows mouse
fd.show();
QApplication::setActiveWindow(&fd);
- QTest::qWaitForWindowShown(&fd);
- QTRY_COMPARE(fd.isVisible(), true);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+ QVERIFY(QTest::qWaitForWindowActive(&fd));
+ QCOMPARE(fd.isVisible(), true);
+ QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
- QTest::qWait(250);
QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit");
+ QVERIFY(lineEdit);
- QCOMPARE(tempPath + QChar('/') + lineEdit->text(), t->fileName());
+ QTRY_COMPARE(tempPath + QChar('/') + lineEdit->text(), t->fileName());
QCOMPARE(tempPath + QChar('/') + lineEdit->selectedText(), t->fileName());
}
fd.show();
QApplication::setActiveWindow(&fd);
- QTest::qWaitForWindowShown(&fd);
- QTRY_COMPARE(fd.isVisible(), true);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+ QVERIFY(QTest::qWaitForWindowActive(&fd));
+ QCOMPARE(fd.isVisible(), true);
+ QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
QFileSystemModel *model = qFindChild<QFileSystemModel*>(&fd, "qt_filesystem_model");
QTRY_COMPARE(model->rowCount(model->index(dir.absolutePath())), 2);
fd.show();
QApplication::setActiveWindow(&fd);
- QTest::qWaitForWindowShown(&fd);
- QTRY_COMPARE(fd.isVisible(), true);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+ QVERIFY(QTest::qWaitForWindowActive(&fd));
+ QCOMPARE(fd.isVisible(), true);
+ QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
QComboBox *filters = qFindChild<QComboBox*>(&fd, "fileTypeCombo");
//We compare the current combobox text with the stripped version
fd2.show();
QApplication::setActiveWindow(&fd2);
- QTest::qWaitForWindowShown(&fd2);
- QTRY_COMPARE(fd2.isVisible(), true);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd2));
+ QVERIFY(QTest::qWaitForWindowActive(&fd2));
+ QCOMPARE(fd2.isVisible(), true);
+ QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd2));
QComboBox *filters2 = qFindChild<QComboBox*>(&fd2, "fileTypeCombo");
//We compare the current combobox text with the non stripped version
fd.show();
QApplication::setActiveWindow(&fd);
- QTest::qWaitForWindowShown(&fd);
- QTRY_COMPARE(fd.isVisible(), true);
- QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
+ QVERIFY(QTest::qWaitForWindowActive(&fd));
+ QCOMPARE(fd.isVisible(), true);
+ QCOMPARE(QApplication::activeWindow(), static_cast<QWidget*>(&fd));
fd.setDirectory("");
QLineEdit *lineEdit = qFindChild<QLineEdit*>(&fd, "fileNameEdit");
int idx = wizard.addPage(&page);
wizard.setStartId(idx);
wizard.show();
- QTest::qWait(100);
+ QVERIFY(QTest::qWaitForWindowExposed(&wizard));
foreach (QLabel *subtitleLabel, qFindChildren<QLabel *>(&wizard)) {
if (subtitleLabel->text().startsWith("SUBTITLE#")) {
QCOMPARE(wiz.maximumHeight(), height);
wiz.show();
- QTest::qWait(100);
+ QVERIFY(QTest::qWaitForWindowExposed(&wiz));
+
QCOMPARE(wiz.size(), QSize(width, height));
QCOMPARE(wiz.minimumWidth(), width);
QCOMPARE(wiz.minimumHeight(), height);
wizard.addPage(&page4);
wizard.show();
- QTest::qWait(100);
+ QVERIFY(QTest::qWaitForWindowExposed(&wizard));
+
QCOMPARE(wizard.currentPage(), &page1);
QTest::mouseClick(wizard.button(QWizard::NextButton), Qt::LeftButton);