summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-07-30 12:36:02 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-01 13:26:03 +0200
commit305cdc7355c4b021cfe54c710aa92a88e12fe188 (patch)
tree0d141f080278556d3ed454f92a5cba6012a2a5b4 /tests/auto/widgets/kernel
parent0838ac541d38b33b23955c036bbcfd94ccc19066 (diff)
Remove usage of deprecated qWaitForWindowShown(QWidget *) method.
Change-Id: I445d24a09dbb7abb62a37bd9914284f21a4f08f1 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'tests/auto/widgets/kernel')
-rw-r--r--tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp10
-rw-r--r--tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp4
-rw-r--r--tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp2
-rw-r--r--tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp3
-rw-r--r--tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp4
-rw-r--r--tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp4
-rw-r--r--tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp4
8 files changed, 14 insertions, 19 deletions
diff --git a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
index 610c0bcba2..2df89c076b 100644
--- a/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
+++ b/tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
@@ -765,7 +765,7 @@ public:
messageBox->setDefaultButton(QMessageBox::Save);
messageBox->show();
- QTest::qWaitForWindowShown(messageBox);
+ QVERIFY(QTest::qWaitForWindowExposed(messageBox));
// verify that all windows are visible
foreach (QWidget *w, qApp->topLevelWidgets())
@@ -797,7 +797,7 @@ void tst_QApplication::closeAllWindows()
// show all windows
foreach (QWidget *w, app.topLevelWidgets()) {
w->show();
- QTest::qWaitForWindowShown(w);
+ QVERIFY(QTest::qWaitForWindowExposed(w));
}
// verify that they are visible
foreach (QWidget *w, app.topLevelWidgets())
@@ -815,7 +815,7 @@ void tst_QApplication::closeAllWindows()
// show all windows
foreach (QWidget *w, app.topLevelWidgets()) {
w->show();
- QTest::qWaitForWindowShown(w);
+ QVERIFY(QTest::qWaitForWindowExposed(w));
}
// close the last window to open the prompt (eventloop recurses)
promptOnCloseWidget->close();
@@ -1917,7 +1917,7 @@ void tst_QApplication::touchEventPropagation()
window.show(); // Must have an explicitly specified QWindow for handleTouchEvent,
// passing 0 would result in using topLevelAt() which is not ok in this case
// as the screen position in the point is bogus.
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
// QPA always takes screen positions and since we map the TouchPoint back to QPA's structure first,
// we must ensure there is a screen position in the TouchPoint that maps to a local 0, 0.
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
@@ -1971,7 +1971,7 @@ void tst_QApplication::touchEventPropagation()
TouchEventPropagationTestWidget widget(&window);
widget.setObjectName("2. widget");
window.show();
- QTest::qWaitForWindowShown(&window);
+ QVERIFY(QTest::qWaitForWindowExposed(&window));
pressedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
releasedTouchPoints[0].setScreenPos(window.mapToGlobal(QPoint(0, 0)));
diff --git a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
index bdcc46d72a..0d36da1eda 100644
--- a/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
+++ b/tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
@@ -260,7 +260,7 @@ void tst_QBoxLayout::taskQTBUG_7103_minMaxWidthNotRespected()
QWidget widget;
widget.setLayout(layout);
widget.show();
- QTest::qWaitForWindowShown(&widget);
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
int height = label->height();
diff --git a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
index 64aa571f19..d4531bcff1 100644
--- a/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
+++ b/tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
@@ -125,7 +125,7 @@ void tst_QDesktopWidget::screenNumberForQWidget()
QWidget widget;
widget.show();
- QTest::qWaitForWindowShown(&widget);
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
QVERIFY(widget.isVisible());
int widgetScreen = desktop.screenNumber(&widget);
@@ -169,7 +169,7 @@ void tst_QDesktopWidget::screenGeometry()
QVERIFY(r.isNull());
QWidget widget;
widget.show();
- QTest::qWaitForWindowShown(&widget);
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
r = desktopWidget->screenGeometry(&widget);
QRect total;
diff --git a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
index be2d49ab7e..b0db1fe88d 100644
--- a/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
+++ b/tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
@@ -704,7 +704,7 @@ void tst_QGridLayout::spacingsAndMargins()
toplevel.show();
toplevel.adjustSize();
QApplication::processEvents();
- QTest::qWaitForWindowShown(&toplevel);
+ QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
QSize topsize = toplevel.size();
QSize minimumsize = vbox.totalMinimumSize();
diff --git a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
index dd91e6968f..2ca25531b6 100644
--- a/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
+++ b/tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
@@ -216,9 +216,8 @@ void tst_QShortcut::initTestCase()
mainW->setFixedSize( 100, 100 );
mainW->setCentralWidget( edit );
mainW->show();
- QTest::qWaitForWindowShown(mainW);
mainW->activateWindow();
- QTest::qWait(100);
+ QVERIFY(QTest::qWaitForWindowActive(mainW));
connect( mainW->statusBar(), SIGNAL(messageChanged(const QString&)),
this, SLOT(statusMessage(const QString&)) );
}
diff --git a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp
index 9c3be62a3a..4536fa9865 100644
--- a/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp
+++ b/tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp
@@ -349,12 +349,10 @@ void tst_QStackedLayout::keepFocusAfterSetCurrent()
testWidget->show();
QApplication::setActiveWindow(testWidget);
- QTest::qWaitForWindowShown(testWidget);
- QApplication::processEvents();
+ QVERIFY(QTest::qWaitForWindowActive(testWidget));
edit1->setFocus();
edit1->activateWindow();
- QTest::qWait(25);
QTRY_VERIFY(edit1->hasFocus());
diff --git a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
index e20111c652..d21a4475cb 100644
--- a/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
+++ b/tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
@@ -106,9 +106,7 @@ void tst_QToolTip::task183679()
Widget_task183679 widget;
widget.show();
QApplication::setActiveWindow(&widget);
- QTest::qWaitForWindowShown(&widget);
- QTest::qWait(30);
-
+ QVERIFY(QTest::qWaitForWindowActive(&widget));
widget.showDelayedToolTip(100);
QTest::qWait(300);
diff --git a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
index 5fba3f2391..4daeb6ceb6 100644
--- a/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
+++ b/tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
@@ -292,7 +292,7 @@ void tst_QWidget_window::tst_showWithoutActivating()
#else
QWidget w;
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QApplication::processEvents();
QApplication::clipboard();
@@ -321,7 +321,7 @@ void tst_QWidget_window::tst_paintEventOnSecondShow()
w.reset();
w.show();
- QTest::qWaitForWindowShown(&w);
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QApplication::processEvents();
QTRY_VERIFY(w.paintEventReceived);
}