diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2012-07-18 13:12:59 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-07-20 09:27:28 +0200 |
commit | 87618403976aa82450895da6196a944195980de7 (patch) | |
tree | 906d035678d8a31e57a94c01e8756b0085b3e1e4 /tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp | |
parent | c081107206cb1d31415539c4429f7896b997cf71 (diff) |
Implement waitForWindowExposed and friends for widget windows.
- Implement waitForWindowExposed() for toplevel windows.
- Implement waitForWindowShown(QWidget *) and mark as
deprecated in line with waitForWindowShown(QWindow*).
- Use in tests.
- Simplify tests (collapse waitForExposed, setActive
into setActiveWindow, waitForActive), remove most
hard-coded timeouts.
- Stabilize graphicsview tests by using waitForWindowActive.
Change-Id: Ic7c061e2745b36f71a715ee4e47c0346b11a91e8
Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
Diffstat (limited to 'tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp')
-rw-r--r-- | tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp index f140e631f2..45b9653982 100644 --- a/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp +++ b/tests/auto/widgets/widgets/qdoublespinbox/tst_qdoublespinbox.cpp @@ -1066,9 +1066,9 @@ void tst_QDoubleSpinBox::taskQTBUG_5008_textFromValueAndValidate() spinbox.activateWindow(); spinbox.setFocus(); QApplication::setActiveWindow(&spinbox); - QTest::qWaitForWindowShown(&spinbox); + QVERIFY(QTest::qWaitForWindowActive(&spinbox)); + QCOMPARE(static_cast<QWidget *>(&spinbox), QApplication::activeWindow()); QTRY_VERIFY(spinbox.hasFocus()); - QTRY_COMPARE(static_cast<QWidget *>(&spinbox), QApplication::activeWindow()); QCOMPARE(spinbox.text(), spinbox.locale().toString(spinbox.value())); spinbox.lineEdit()->setCursorPosition(2); //just after the first thousand separator QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_0); // let's insert a 0 |