Remove usage of deprecated qWaitForWindowShown(QWidget *) method.
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>
Mon, 30 Jul 2012 10:36:02 +0000 (12:36 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 1 Aug 2012 11:26:03 +0000 (13:26 +0200)
Change-Id: I445d24a09dbb7abb62a37bd9914284f21a4f08f1
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
35 files changed:
tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
tests/auto/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp
tests/auto/widgets/graphicsview/qgraphicslayout/tst_qgraphicslayout.cpp
tests/auto/widgets/graphicsview/qgraphicslinearlayout/tst_qgraphicslinearlayout.cpp
tests/auto/widgets/graphicsview/qgraphicsproxywidget/tst_qgraphicsproxywidget.cpp
tests/auto/widgets/graphicsview/qgraphicsscene/tst_qgraphicsscene.cpp
tests/auto/widgets/graphicsview/qgraphicssceneindex/tst_qgraphicssceneindex.cpp
tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
tests/auto/widgets/graphicsview/qgraphicswidget/tst_qgraphicswidget.cpp
tests/auto/widgets/kernel/qapplication/tst_qapplication.cpp
tests/auto/widgets/kernel/qboxlayout/tst_qboxlayout.cpp
tests/auto/widgets/kernel/qdesktopwidget/tst_qdesktopwidget.cpp
tests/auto/widgets/kernel/qgridlayout/tst_qgridlayout.cpp
tests/auto/widgets/kernel/qshortcut/tst_qshortcut.cpp
tests/auto/widgets/kernel/qstackedlayout/tst_qstackedlayout.cpp
tests/auto/widgets/kernel/qtooltip/tst_qtooltip.cpp
tests/auto/widgets/kernel/qwidget_window/tst_qwidget_window.cpp
tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp
tests/auto/widgets/widgets/qcalendarwidget/tst_qcalendarwidget.cpp
tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp
tests/auto/widgets/widgets/qcommandlinkbutton/tst_qcommandlinkbutton.cpp
tests/auto/widgets/widgets/qdockwidget/tst_qdockwidget.cpp
tests/auto/widgets/widgets/qlabel/tst_qlabel.cpp
tests/auto/widgets/widgets/qlineedit/tst_qlineedit.cpp
tests/auto/widgets/widgets/qmainwindow/tst_qmainwindow.cpp
tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp
tests/auto/widgets/widgets/qmdisubwindow/tst_qmdisubwindow.cpp
tests/auto/widgets/widgets/qmenu/tst_qmenu.cpp
tests/auto/widgets/widgets/qmenubar/tst_qmenubar.cpp
tests/auto/widgets/widgets/qprogressbar/tst_qprogressbar.cpp
tests/auto/widgets/widgets/qspinbox/tst_qspinbox.cpp
tests/auto/widgets/widgets/qtabbar/tst_qtabbar.cpp
tests/auto/widgets/widgets/qtabwidget/tst_qtabwidget.cpp
tests/auto/widgets/widgets/qtextbrowser/tst_qtextbrowser.cpp
tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp

index 1721e83..0aee5e9 100644 (file)
@@ -412,7 +412,7 @@ void tst_QGraphicsEffect::opacity()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTRY_VERIFY(effect->numRepaints > 0);
     QCOMPARE(effect->m_opacity, qreal(0.5));
 }
@@ -551,7 +551,7 @@ void tst_QGraphicsEffect::drawPixmapItem()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTRY_VERIFY(effect->repaints >= 1);
 
     item->rotate(180);
@@ -593,7 +593,7 @@ void tst_QGraphicsEffect::deviceCoordinateTranslateCaching()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QTRY_VERIFY(item->numRepaints >= 1);
     int numRepaints = item->numRepaints;
@@ -619,7 +619,7 @@ void tst_QGraphicsEffect::inheritOpacity()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QTRY_VERIFY(item->numRepaints >= 1);
 
@@ -679,7 +679,7 @@ void tst_QGraphicsEffect::childrenVisibilityShouldInvalidateCache()
     QGraphicsView view(&scene);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
     QTRY_VERIFY(parent.nbPaint >= 1);
     //we set an effect on the parent
     parent.setGraphicsEffect(new QGraphicsDropShadowEffect(&parent));
index c292e0f..41ef60f 100644 (file)
@@ -1559,7 +1559,7 @@ void tst_QGraphicsItem::selected()
     view.setFixedSize(250, 250);
     view.show();
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     qApp->processEvents();
     qApp->processEvents();
 
@@ -1688,7 +1688,7 @@ void tst_QGraphicsItem::selected_textItem()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(20);
 
     QTRY_VERIFY(!text->isSelected());
@@ -3369,7 +3369,7 @@ void tst_QGraphicsItem::childrenBoundingRect()
     QGraphicsView view(&scene);
     view.show();
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(30);
 
     QCOMPARE(parent->childrenBoundingRect(), QRectF(-500, -100, 600, 800));
@@ -3470,7 +3470,7 @@ void tst_QGraphicsItem::childrenBoundingRect4()
     QGraphicsView view(&scene);
     view.show();
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     // Try to mess up the cached bounding rect.
     rect->childrenBoundingRect();
@@ -3494,7 +3494,7 @@ void tst_QGraphicsItem::childrenBoundingRect5()
     QGraphicsView view(&scene);
     view.show();
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     // Try to mess up the cached bounding rect.
     QRectF expectedChildrenBoundingRect = parent->boundingRect();
@@ -3529,8 +3529,7 @@ void tst_QGraphicsItem::group()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
-    QApplication::processEvents();
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QGraphicsItemGroup *group = new QGraphicsItemGroup;
     group->setSelected(true);
@@ -3767,7 +3766,7 @@ void tst_QGraphicsItem::handlesChildEvents()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(20);
 
     // Pull out the items, closest item first
@@ -3891,7 +3890,7 @@ void tst_QGraphicsItem::handlesChildEvents2()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
 
     QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5),
@@ -3980,7 +3979,7 @@ void tst_QGraphicsItem::filtersChildEvents()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(20);
 
     QGraphicsSceneMouseEvent pressEvent(QEvent::GraphicsSceneMousePress);
@@ -4051,7 +4050,7 @@ void tst_QGraphicsItem::filtersChildEvents2()
     QGraphicsView view(&scene);
     view.show();
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
 
     QMouseEvent event(QEvent::MouseButtonPress, view.mapFromScene(5, 5),
@@ -4099,7 +4098,7 @@ void tst_QGraphicsItem::ensureVisible()
     QGraphicsView view(&scene);
     view.setFixedSize(300, 300);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     for (int i = 0; i < 25; ++i) {
         view.scale(qreal(1.06), qreal(1.06));
@@ -5014,7 +5013,7 @@ void tst_QGraphicsItem::sceneEventFilter()
     QGraphicsTextItem *ti3 = anotherScene->addText("This is a test #3");
     gv.setScene(anotherScene);
     gv.show();
-    QTest::qWaitForWindowShown(&gv);
+    QVERIFY(QTest::qWaitForWindowExposed(&gv));
     QTest::qWait(25);
     ti->installSceneEventFilter(ti2);
     ti3->installSceneEventFilter(ti);
@@ -5072,7 +5071,7 @@ void tst_QGraphicsItem::paint()
         view.showFullScreen();
     else
         view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
 #ifdef Q_OS_WIN32
     //we try to switch the desktop: if it fails, we skip the test
@@ -5088,7 +5087,7 @@ void tst_QGraphicsItem::paint()
     QGraphicsScene scene2;
     QGraphicsView view2(&scene2);
     view2.show();
-    QTest::qWaitForWindowShown(&view2);
+    QVERIFY(QTest::qWaitForWindowExposed(&view2));
     QTest::qWait(25);
 
     PaintTester tester2;
@@ -6094,7 +6093,7 @@ void tst_QGraphicsItem::untransformable()
     view.setBackgroundBrush(QBrush(Qt::black, Qt::DiagCrossPattern));
 #endif
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
 
     for (int i = 0; i < 10; ++i) {
         QPoint center = view.viewport()->rect().center();
@@ -6157,7 +6156,7 @@ void tst_QGraphicsItem::contextMenuEventPropagation()
     view.setAlignment(Qt::AlignLeft | Qt::AlignTop);
     view.show();
     view.resize(200, 200);
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(20);
 
     QContextMenuEvent event(QContextMenuEvent::Mouse, QPoint(10, 10),
@@ -6259,7 +6258,7 @@ void tst_QGraphicsItem::task141694_textItemEnsureVisible()
     QGraphicsView view(&scene);
     view.setFixedSize(200, 200);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     view.ensureVisible(-1000, -1000, 5, 5);
     int hscroll = view.horizontalScrollBar()->value();
@@ -6433,7 +6432,7 @@ void tst_QGraphicsItem::ensureUpdateOnTextItem()
     QGraphicsScene scene;
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(25);
     TextItem *text1 = new TextItem(QLatin1String("123"));
     scene.addItem(text1);
@@ -6860,7 +6859,7 @@ void tst_QGraphicsItem::itemStacksBehindParent()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTRY_VERIFY(!paintedItems.isEmpty());
     QTest::qWait(100);
     paintedItems.clear();
@@ -6958,7 +6957,7 @@ void tst_QGraphicsItem::nestedClipping()
     QGraphicsView view(&scene);
     view.setOptimizationFlag(QGraphicsView::IndirectPainting);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(25);
 
     QList<QGraphicsItem *> expected;
@@ -7173,7 +7172,7 @@ void tst_QGraphicsItem::cacheMode()
     view.resize(150, 150);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
 
     // Increase the probability of window activation
     // not causing another repaint of test items.
@@ -7367,7 +7366,7 @@ void tst_QGraphicsItem::cacheMode2()
     view.resize(150, 150);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
 
     // Increase the probability of window activation
     // not causing another repaint of test items.
@@ -7444,7 +7443,7 @@ void tst_QGraphicsItem::updateCachedItemAfterMove()
     scene.addItem(tester);
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QTest::qWait(12);
     QTRY_VERIFY(tester->repaints > 0);
@@ -7870,7 +7869,7 @@ void tst_QGraphicsItem::itemUsesExtendedStyleOption()
     topLevel.setWindowFlags(Qt::X11BypassWindowManagerHint);
     rect->startTrack = false;
     topLevel.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
     QTest::qWait(60);
     rect->startTrack = true;
     rect->update(10, 10, 10, 10);
@@ -9059,8 +9058,9 @@ void tst_QGraphicsItem::ensureDirtySceneTransform()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+    QApplication::setActiveWindow(&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
 
     //We move the parent
     parent->move();
@@ -9349,8 +9349,9 @@ void tst_QGraphicsItem::QTBUG_4233_updateCachedWithSceneRect()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+    QApplication::setActiveWindow(&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
 
     QTRY_COMPARE(tester->repaints, 1);
 
@@ -10427,7 +10428,7 @@ void tst_QGraphicsItem::textItem_shortcuts()
     item->setFlag(QGraphicsItem::ItemIsFocusable);
     item->setTextInteractionFlags(Qt::TextEditorInteraction);
     w.show();
-    QTest::qWaitForWindowShown(&w);
+    QVERIFY(QTest::qWaitForWindowExposed(&w));
 
     item->setFocus();
     QTRY_VERIFY(item->hasFocus());
@@ -10589,7 +10590,7 @@ void tst_QGraphicsItem::focusHandling()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QApplication::setActiveWindow(&view);
     QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
@@ -10674,7 +10675,7 @@ void tst_QGraphicsItem::touchEventPropagation()
     QGraphicsView view(&scene);
     view.setSceneRect(touchEventReceiver->boundingRect());
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(touchEventReceiver->touchBeginEventCount, 0);
 
@@ -10710,7 +10711,7 @@ void tst_QGraphicsItem::deviceCoordinateCache_simpleRotations()
 
     MyGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTRY_VERIFY(view.repaints > 0);
 
     QGraphicsItemCache *itemCache = QGraphicsItemPrivate::get(item)->extraItemCache();
@@ -10790,7 +10791,7 @@ void tst_QGraphicsItem::QTBUG_5418_textItemSetDefaultColor()
     QGraphicsScene scene;
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     scene.addItem(i);
     QApplication::processEvents();
     QTRY_VERIFY(i->painted);
@@ -11126,8 +11127,8 @@ void tst_QGraphicsItem::itemDiesDuringDraggingOperation()
     scene.addItem(item);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
     QGraphicsSceneDragDropEvent dragEnter(QEvent::GraphicsSceneDragEnter);
     dragEnter.setScenePos(item->boundingRect().center());
     QApplication::sendEvent(&scene, &dragEnter);
@@ -11153,8 +11154,8 @@ void tst_QGraphicsItem::QTBUG_12112_focusItem()
 
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
 
     QVERIFY(item1->focusItem());
     QVERIFY(!item2->focusItem());
@@ -11238,7 +11239,7 @@ void tst_QGraphicsItem::QTBUG_16374_crashInDestructor()
     scene.addItem(&win);
 
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 }
 
 void tst_QGraphicsItem::QTBUG_20699_focusScopeCrash()
@@ -11258,7 +11259,7 @@ void tst_QGraphicsItem::QTBUG_20699_focusScopeCrash()
     fi->setFocus();
 
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     fi->setParentItem(fi2);
     fi->setFocus();
index fdf4ead..e244d9f 100644 (file)
@@ -147,7 +147,7 @@ void tst_QGraphicsLayout::compressLayoutRequest()
     scene.addItem(tw);
     view.show();
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QGraphicsLinearLayout *lout = new QGraphicsLinearLayout(tw);
     for (int i = 0; i < 4; ++i) {
         QGraphicsWidget *gw = new QGraphicsWidget(tw);
index 35b67d4..06d768e 100644 (file)
@@ -339,7 +339,7 @@ void tst_QGraphicsLinearLayout::alignment()
         widget->resize(newSize);
     view.show();
     widget->show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
 
     int x = 0;
@@ -669,7 +669,7 @@ void tst_QGraphicsLinearLayout::invalidate()
     view.show();
     widget->show();
     //QTest::qWait(1000);
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     qApp->processEvents();
     layout.layoutRequest = 0;
 
@@ -1158,7 +1158,7 @@ void tst_QGraphicsLinearLayout::testStretch()
 
     //view->setSceneRect(-50, -50, 800, 800);
     //view->show();
-    //QTest::qWaitForWindowShown(view);
+    //QVERIFY(QTest::qWaitForWindowExposed(view));
     //QTest::qWait(5000);
     QCOMPARE(form->geometry().size(), QSizeF(600,600));
     QCOMPARE(w1->geometry(), QRectF(0, 0, 100, 100));
index 53c8be4..74cd45c 100644 (file)
@@ -1088,8 +1088,8 @@ void tst_QGraphicsProxyWidget::keyPressEvent()
     view.show();
     view.viewport()->setFocus();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
 
     SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
     proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
@@ -1129,8 +1129,8 @@ void tst_QGraphicsProxyWidget::keyReleaseEvent()
     QGraphicsView view(&scene);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
 
 
     SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
@@ -1173,8 +1173,8 @@ void tst_QGraphicsProxyWidget::mouseDoubleClickEvent()
     view.show();
 
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
 
     SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
     proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
@@ -1217,7 +1217,7 @@ void tst_QGraphicsProxyWidget::mousePressReleaseEvent()
     QGraphicsScene scene;
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     SubQGraphicsProxyWidget *proxy = new SubQGraphicsProxyWidget;
     proxy->setFlag(QGraphicsItem::ItemIsFocusable, true); // ### remove me!!!
@@ -1279,8 +1279,8 @@ void tst_QGraphicsProxyWidget::paintEvent()
     QGraphicsView view(&scene);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QTRY_VERIFY(view.isActiveWindow());
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QVERIFY(view.isActiveWindow());
 
     SubQGraphicsProxyWidget proxy;
 
@@ -1289,7 +1289,7 @@ void tst_QGraphicsProxyWidget::paintEvent()
     //this bug prevents the widget from being updated
 
     w->show();
-    QTest::qWaitForWindowShown(w);
+    QVERIFY(QTest::qWaitForWindowExposed(w));
     QApplication::processEvents();
     QTest::qWait(30);
     proxy.setWidget(w);
@@ -1691,7 +1691,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleWidget()
     window.show();
     QApplication::setActiveWindow(&window);
     window.activateWindow();
-    QTest::qWaitForWindowShown(&window);
+    QVERIFY(QTest::qWaitForWindowActive(&window));
 
     leftDial->setFocus();
     QApplication::processEvents();
@@ -1775,7 +1775,7 @@ void tst_QGraphicsProxyWidget::tabFocus_simpleTwoWidgets()
     window.show();
     QApplication::setActiveWindow(&window);
     window.activateWindow();
-    QTest::qWaitForWindowShown(&window);
+    QVERIFY(QTest::qWaitForWindowActive(&window));
 
     leftDial->setFocus();
     QApplication::processEvents();
@@ -1908,7 +1908,7 @@ void tst_QGraphicsProxyWidget::tabFocus_complexWidget()
     window.show();
     QApplication::setActiveWindow(&window);
     window.activateWindow();
-    QTest::qWaitForWindowShown(&window);
+    QVERIFY(QTest::qWaitForWindowActive(&window));
 
     leftDial->setFocus();
     QApplication::processEvents();
@@ -2219,8 +2219,8 @@ void tst_QGraphicsProxyWidget::setFocus_simpleWidget()
     window.show();
     QApplication::setActiveWindow(&window);
     window.activateWindow();
-    QTest::qWaitForWindowShown(&window);
-    QTRY_COMPARE(QApplication::activeWindow(), &window);
+    QVERIFY(QTest::qWaitForWindowActive(&window));
+    QCOMPARE(QApplication::activeWindow(), &window);
 
     leftDial->setFocus();
     QApplication::processEvents();
@@ -2291,8 +2291,8 @@ void tst_QGraphicsProxyWidget::setFocus_simpleTwoWidgets()
     window.show();
     QApplication::setActiveWindow(&window);
     window.activateWindow();
-    QTest::qWaitForWindowShown(&window);
-    QTRY_COMPARE(QApplication::activeWindow(), &window);
+    QVERIFY(QTest::qWaitForWindowActive(&window));
+    QCOMPARE(QApplication::activeWindow(), &window);
 
     leftDial->setFocus();
     QApplication::processEvents();
@@ -2370,8 +2370,8 @@ void tst_QGraphicsProxyWidget::setFocus_complexTwoWidgets()
     window.show();
     QApplication::setActiveWindow(&window);
     window.activateWindow();
-    QTest::qWaitForWindowShown(&window);
-    QTRY_COMPARE(QApplication::activeWindow(), &window);
+    QVERIFY(QTest::qWaitForWindowActive(&window));
+    QCOMPARE(QApplication::activeWindow(), &window);
 
     leftDial->setFocus();
     QApplication::processEvents();
@@ -2461,7 +2461,7 @@ void tst_QGraphicsProxyWidget::popup_basic()
     QCOMPARE(box->pos(), QPoint());
     QCOMPARE(proxy->pos(), QPointF());
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(125);
     QApplication::processEvents();
 
@@ -2556,9 +2556,8 @@ void tst_QGraphicsProxyWidget::changingCursor_basic()
     proxy->show();
     scene.addItem(proxy);
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QApplication::processEvents();
-    QTRY_VERIFY(view.isActiveWindow());
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QVERIFY(view.isActiveWindow());
 
     // in
     QTest::mouseMove(view.viewport(), view.mapFromScene(proxy->mapToScene(proxy->boundingRect().center())));
@@ -2967,7 +2966,7 @@ void tst_QGraphicsProxyWidget::dontCrashWhenDie()
 {
     MainWidget *w = new MainWidget();
     w->show();
-    QTest::qWaitForWindowShown(w);
+    QVERIFY(QTest::qWaitForWindowExposed(w));
     QTest::qWait(100);
     QTest::mouseMove(w->view->viewport(), w->view->mapFromScene(w->widget->mapToScene(w->widget->boundingRect().center())));
     delete w->item;
@@ -3120,7 +3119,7 @@ void tst_QGraphicsProxyWidget::actionsContextMenu()
     QGraphicsView view(&scene);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
     view.setFocus();
     QTRY_VERIFY(view.hasFocus());
 
@@ -3627,8 +3626,8 @@ void tst_QGraphicsProxyWidget::QTBUG_6986_sendMouseEventToAlienWidget()
     view.resize(600, 600);
     QApplication::setActiveWindow(&view);
     view.show();
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), &view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), &view);
     QCursor::setPos(view.mapToGlobal(view.mapFromScene(scene.topButton->boundingRect().center())));
     QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.mapFromScene(scene.topButton->scenePos()));
     QTRY_COMPARE(scene.hoverButton->hoverLeaveReceived, true);
index 7299e2a..e188805 100644 (file)
@@ -3138,8 +3138,8 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusableItems()
     widget.show();
     qApp->setActiveWindow(&widget);
     widget.activateWindow();
-    QTest::qWaitForWindowShown(&widget);
-    QTRY_VERIFY(view->hasFocus());
+    QVERIFY(QTest::qWaitForWindowActive(&widget));
+    QVERIFY(view->hasFocus());
     QTRY_VERIFY(scene.isActive());
     QVERIFY(view->viewport()->hasFocus());
     QVERIFY(scene.hasFocus());
@@ -3219,8 +3219,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets()
     widget.show();
     qApp->setActiveWindow(&widget);
     widget.activateWindow();
-    QTest::qWaitForWindowShown(&widget);
-    QApplication::processEvents();
+    QVERIFY(QTest::qWaitForWindowActive(&widget));
 
     dial1->setFocus();
     QTRY_VERIFY(dial1->hasFocus());
@@ -3259,7 +3258,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithFocusWidgets()
     widget.show();
     qApp->setActiveWindow(&widget);
     widget.activateWindow();
-    QTest::qWaitForWindowShown(&widget);
+    QVERIFY(QTest::qWaitForWindowActive(&widget));
     QTRY_VERIFY(widget1->hasFocus());
 }
 
@@ -3303,7 +3302,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets()
     widget.show();
     qApp->setActiveWindow(&widget);
     widget.activateWindow();
-    QTest::qWaitForWindowShown(&widget);
+    QVERIFY(QTest::qWaitForWindowActive(&widget));
 
     dial1->setFocus();
     QTRY_VERIFY(dial1->hasFocus());
@@ -3388,8 +3387,7 @@ void tst_QGraphicsScene::tabFocus_sceneWithNestedFocusWidgets()
     widget.show();
     qApp->setActiveWindow(&widget);
     widget.activateWindow();
-    QTest::qWaitForWindowShown(&widget);
-    QApplication::processEvents();
+    QVERIFY(QTest::qWaitForWindowActive(&widget));
     QTRY_VERIFY(widget1->hasFocus());
 }
 
@@ -4181,8 +4179,8 @@ void tst_QGraphicsScene::isActive()
 
         toplevel3.show();
         QApplication::setActiveWindow(&toplevel3);
-        QTest::qWaitForWindowShown(&toplevel3);
-        QTRY_COMPARE(QApplication::activeWindow(), &toplevel3);
+        QVERIFY(QTest::qWaitForWindowActive(&toplevel3));
+        QCOMPARE(QApplication::activeWindow(), &toplevel3);
 
         QVERIFY(scene1.isActive());
         QVERIFY(!scene2.isActive());
@@ -4350,7 +4348,7 @@ void tst_QGraphicsScene::taskQT657_paintIntoCacheWithTransparentParts()
     proxy->rotate(15);
 
     view->show();
-    QTest::qWaitForWindowShown(view);
+    QVERIFY(QTest::qWaitForWindowExposed(view));
     view->repaints = 0;
     proxy->update(10, 10, 10, 10);
     QTest::qWait(50);
@@ -4396,7 +4394,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
         backItem->rotate(15);
 
         view->show();
-        QTest::qWaitForWindowShown(view);
+        QVERIFY(QTest::qWaitForWindowExposed(view));
         view->repaints = 0;
         rectItem->update(10, 10, 10, 10);
         QTest::qWait(50);
@@ -4438,7 +4436,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
         rectItem->rotate(15);
 
         view->show();
-        QTest::qWaitForWindowShown(view);
+        QVERIFY(QTest::qWaitForWindowExposed(view));
         view->repaints = 0;
         rectItem->update(10, 10, 10, 10);
         QTest::qWait(50);
@@ -4479,7 +4477,7 @@ void tst_QGraphicsScene::taskQTBUG_7863_paintIntoCacheWithTransparentParts()
         rectItem->rotate(15);
 
         view->show();
-        QTest::qWaitForWindowShown(view);
+        QVERIFY(QTest::qWaitForWindowExposed(view));
         view->repaints = 0;
         rectItem->update(10, 10, 10, 10);
         QTest::qWait(50);
@@ -4581,8 +4579,8 @@ void tst_QGraphicsScene::taskQTBUG_16401_focusItem()
     rect->setFlag(QGraphicsItem::ItemIsFocusable);
 
     view.show();
-    QTest::qWaitForWindowShown(&view);
     QApplication::setActiveWindow(&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
 
     QVERIFY(!scene.focusItem());
 
index 450b970..b7c99d5 100644 (file)
@@ -276,9 +276,7 @@ void tst_QGraphicsSceneIndex::removeItems()
     view.resize(600, 600);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-
-    QApplication::processEvents();
+    QVERIFY(QTest::qWaitForWindowActive(&view));
 
     scene.removeItem(widgetChild1);
 
index df15090..a27e14b 100644 (file)
@@ -309,7 +309,7 @@ void tst_QGraphicsView::construction()
     QCOMPARE(view.transformationAnchor(), QGraphicsView::AnchorViewCenter);
     QCOMPARE(view.resizeAnchor(), QGraphicsView::NoAnchor);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 }
 
 class TestItem : public QGraphicsItem
@@ -357,7 +357,7 @@ void tst_QGraphicsView::renderHints()
 
     QCOMPARE(item->hints, 0);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     view.repaint();
     QTRY_COMPARE(item->hints, view.renderHints());
 
@@ -375,7 +375,7 @@ void tst_QGraphicsView::alignment()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     for (int i = 0; i < 3; ++i) {
         for (int j = 0; j < 3; ++j) {
@@ -492,7 +492,7 @@ void tst_QGraphicsView::setScene()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(view.sceneRect(), scene.sceneRect());
 
@@ -664,7 +664,7 @@ void tst_QGraphicsView::dragMode_scrollHand()
         view.setFixedSize(100, 100);
         view.show();
 
-        QTest::qWaitForWindowShown(&view);
+        QVERIFY(QTest::qWaitForWindowExposed(&view));
         QApplication::processEvents();
 
         view.setInteractive(j ? false : true);
@@ -800,7 +800,7 @@ void tst_QGraphicsView::dragMode_rubberBand()
 
     view.setDragMode(QGraphicsView::RubberBandDrag);
 
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
 
     for (int i = 0; i < 2; ++i) {
@@ -1157,7 +1157,7 @@ void tst_QGraphicsView::centerOnItem()
     QGraphicsView view(&scene);
     view.setSceneRect(-1000, -1000, 2000, 2000);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     int tolerance = 7;
 
     for (int x = 0; x < 3; ++x) {
@@ -1209,7 +1209,7 @@ void tst_QGraphicsView::ensureVisibleRect()
     view.setSceneRect(-500, -500, 1000, 1000);
     view.setFixedSize(250, 250);
     toplevel.show();
-    QTest::qWaitForWindowShown(&toplevel);
+    QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
 
     for (int y = -100; y < 100; y += 25) {
         for (int x = -100; x < 100; x += 13) {
@@ -1404,7 +1404,7 @@ void tst_QGraphicsView::itemsAtPosition()
     view.setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
     view.setScene(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QPoint screenPos = view.viewport()->mapToGlobal(viewPos);
     QPointF scenePos = view.mapToScene(viewPos);
@@ -1659,7 +1659,7 @@ void tst_QGraphicsView::itemAt2()
     view.setTransformationAnchor(QGraphicsView::NoAnchor);
     view.setRenderHint(QPainter::Antialiasing);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
 
     QPoint itemViewPoint = view.mapFromScene(item->scenePos());
@@ -2018,10 +2018,9 @@ void tst_QGraphicsView::sendEvent()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
     QApplication::setActiveWindow(&view);
-    QTest::qWait(20);
-    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
 
     item->setFocus();
 
@@ -2086,10 +2085,9 @@ void tst_QGraphicsView::wheelEvent()
     // Assign a view.
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
     QApplication::setActiveWindow(&view);
-    QTest::qWait(20);
-    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
 
 
     // Send a wheel event with horizontal orientation.
@@ -2130,7 +2128,7 @@ void tst_QGraphicsView::cursor()
     QGraphicsView view(&scene);
     view.setFixedSize(400, 400);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(view.viewport()->cursor().shape(), QCursor().shape());
     view.viewport()->setCursor(Qt::PointingHandCursor);
@@ -2167,7 +2165,7 @@ void tst_QGraphicsView::cursor2()
     view.viewport()->setCursor(Qt::PointingHandCursor);
     view.setFixedSize(400, 400);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     sendMouseMove(view.viewport(), view.mapFromScene(-30, -30));
     QCOMPARE(view.viewport()->cursor().shape(), Qt::PointingHandCursor);
@@ -2268,7 +2266,7 @@ void tst_QGraphicsView::resizeAnchor()
     for (int i = 0; i < 2; ++i) {
         view.resize(100, 100);
         view.show();
-        QTest::qWaitForWindowShown(&view);
+        QVERIFY(QTest::qWaitForWindowExposed(&view));
         QApplication::processEvents();
 
         if (i == 0) {
@@ -2420,8 +2418,8 @@ void tst_QGraphicsView::viewportUpdateMode2()
     view.getContentsMargins(&left, &top, &right, &bottom);
     view.resize(200 + left + right, 200 + top + bottom);
     toplevel.show();
-    QTest::qWaitForWindowShown(&toplevel);
-    QTest::qWait(50);
+    qApp->setActiveWindow(&toplevel);
+    QVERIFY(QTest::qWaitForWindowActive(&toplevel));
     QTRY_VERIFY(view.painted);
     const QRect viewportRect = view.viewport()->rect();
     QCOMPARE(viewportRect, QRect(0, 0, 200, 200));
@@ -2568,7 +2566,7 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     view.viewport()->repaint();
 
     QVERIFY(!parent->dirtyPainter);
@@ -2586,12 +2584,12 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState()
 
     MyGraphicsView painter(&scene);
     painter.show();
-    QTest::qWaitForWindowShown(&painter);
+    QVERIFY(QTest::qWaitForWindowExposed(&painter));
 
     MyGraphicsView painter2(&scene);
     painter2.setOptimizationFlag(QGraphicsView::DontSavePainterState,true);
     painter2.show();
-    QTest::qWaitForWindowShown(&painter2);
+    QVERIFY(QTest::qWaitForWindowExposed(&painter2));
 }
 
 void tst_QGraphicsView::optimizationFlags_dontSavePainterState2_data()
@@ -2730,7 +2728,7 @@ void tst_QGraphicsView::levelOfDetail()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QTRY_COMPARE(item->lastLod, qreal(1));
 
@@ -2823,7 +2821,7 @@ void tst_QGraphicsView::acceptMousePressEvent()
 
     TestView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QMouseEvent event(QEvent::MouseButtonPress,
                       view.viewport()->rect().center(),
@@ -2898,7 +2896,7 @@ void tst_QGraphicsView::itemsUnderMouse()
 
    QGraphicsView view(&scene);
    view.show();
-   QTest::qWaitForWindowShown(&view);
+   QVERIFY(QTest::qWaitForWindowExposed(&view));
 
    QCOMPARE(view.items(view.mapFromScene(w3.boundingRect().center())).first(),
             static_cast<QGraphicsItem *>(&w3));
@@ -2935,9 +2933,9 @@ void tst_QGraphicsView::task172231_untransformableItems()
 
     view.scale(2, 1);
     view.show();
-    QTest::qWaitForWindowShown(&view);
     QApplication::setActiveWindow(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
 
     QRectF origExposedRect = text->exposedRect;
 
@@ -3042,7 +3040,7 @@ void tst_QGraphicsView::task186827_deleteReplayedItem()
     MouseMoveCounter view;
     view.setScene(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     view.viewport()->setMouseTracking(true);
 
     QCOMPARE(view.mouseMoves, 0);
@@ -3076,10 +3074,10 @@ void tst_QGraphicsView::task207546_focusCrash()
     widget.layout()->addWidget(gr1);
     widget.layout()->addWidget(gr2);
     widget.show();
-    QTest::qWaitForWindowShown(&widget);
     widget.activateWindow();
     QApplication::setActiveWindow(&widget);
-    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&widget));
+    QVERIFY(QTest::qWaitForWindowActive(&widget));
+    QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&widget));
     widget.focusNextPrevChild(true);
     QCOMPARE(static_cast<QWidget *>(gr2), widget.focusWidget());
 }
@@ -3219,7 +3217,7 @@ void tst_QGraphicsView::task245469_itemsAtPointWithClip()
     view.resize(150,150);
     view.rotate(90);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QList<QGraphicsItem *> itemsAtCenter = view.items(view.viewport()->rect().center());
     QCOMPARE(itemsAtCenter, (QList<QGraphicsItem *>() << child << parent));
@@ -3338,7 +3336,7 @@ void tst_QGraphicsView::scrollAfterResize()
     view.setSceneRect(-1000, -1000, 2000, 2000);
     view.resize(300, 300);
     toplevel.show();
-    QTest::qWaitForWindowShown(&toplevel);
+    QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
     view.horizontalScrollBar()->setValue(0);
     view.verticalScrollBar()->setValue(0);
     QCOMPARE(view.viewportTransform(), x1);
@@ -3408,7 +3406,7 @@ void tst_QGraphicsView::moveItemWhileScrolling()
     view.show();
     if (changedConnected)
         QObject::connect(view.scene(), SIGNAL(changed(QList<QRectF>)), this, SLOT(dummySlot()));
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
     QTRY_VERIFY(view.painted);
     view.painted = false;
@@ -3445,7 +3443,7 @@ void tst_QGraphicsView::centerOnDirtyItem()
     view.centerOn(item);
 
     toplevel.show();
-    QTest::qWaitForWindowShown(&toplevel);
+    QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
     QTest::qWait(50);
 
     QImage before(view.viewport()->size(), QImage::Format_ARGB32);
@@ -3575,7 +3573,7 @@ void tst_QGraphicsView::mouseTracking2()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QVERIFY(!view.viewport()->hasMouseTracking());
     view.viewport()->setMouseTracking(true); // Explicitly enable mouse tracking.
@@ -3711,7 +3709,7 @@ void tst_QGraphicsView::render()
     view.resize(200, 200);
     view.painted = false;
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QApplication::processEvents();
     QTRY_VERIFY(view.painted);
 
@@ -3824,7 +3822,7 @@ void tst_QGraphicsView::update()
     view.getContentsMargins(&left, &top, &right, &bottom);
     view.resize(200 + left + right, 200 + top + bottom);
     toplevel.show();
-    QTest::qWaitForWindowShown(&toplevel);
+    QVERIFY(QTest::qWaitForWindowExposed(&toplevel));
 
 
     QApplication::setActiveWindow(&toplevel);
@@ -4091,9 +4089,9 @@ void tst_QGraphicsView::inputMethodSensitivity()
     QGraphicsScene scene;
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
     QApplication::setActiveWindow(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&view));
 
     FocusItem *item = new FocusItem;
 
@@ -4247,7 +4245,7 @@ void tst_QGraphicsView::indirectPainting()
     QGraphicsView view(&scene);
     view.setOptimizationFlag(QGraphicsView::IndirectPainting);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTest::qWait(100);
 
     scene.drawCount = 0;
@@ -4274,7 +4272,7 @@ void tst_QGraphicsView::compositionModeInDrawBackground()
     QGraphicsScene dummy;
     MyView view(&dummy);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     // Make sure the painter's composition mode is SourceOver in drawBackground.
     QTRY_VERIFY(view.painted);
@@ -4399,7 +4397,7 @@ void tst_QGraphicsView::task259503_scrollingArtifacts()
 
     SAGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     int hsbValue = view.horizontalScrollBar()->value();
     view.horizontalScrollBar()->setValue(hsbValue / 2);
@@ -4456,10 +4454,9 @@ void tst_QGraphicsView::QTBUG_4151_clipAndIgnore()
     view.setFrameStyle(0);
     view.resize(75, 75);
     view.show();
-    QTest::qWaitForWindowShown(&view);
     view.activateWindow();
-
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget *)&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget *)&view);
 
     QCOMPARE(view.items(view.rect()).size(), numItems);
 }
@@ -4518,7 +4515,7 @@ void tst_QGraphicsView::QTBUG_7438_cursor()
     QGraphicsView view(&scene);
     view.setFixedSize(400, 400);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(view.viewport()->cursor().shape(), QCursor().shape());
     view.viewport()->setCursor(Qt::PointingHandCursor);
index 66d228a..7a8e6f1 100644 (file)
@@ -680,7 +680,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveToChildren()
     QGraphicsView view;
     view.setScene(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
     QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
@@ -715,7 +715,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveToGrandChildren()
     QGraphicsView view;
     view.setScene(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
     QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
@@ -751,7 +751,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveViaNonWidget()
     QGraphicsView view;
     view.setScene(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
     QCOMPARE(grandChild1->font().resolve(), uint(QFont::StyleResolved));
@@ -787,7 +787,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveFromScene()
     QGraphicsView view;
     view.setScene(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QCOMPARE(font.resolve(), uint(QFont::StyleResolved));
     QCOMPARE(root->font().resolve(), uint(QFont::StyleResolved));
@@ -835,7 +835,7 @@ void tst_QGraphicsWidget::fontPropagatesResolveInParentChange()
     QGraphicsView view;
     view.setScene(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QVERIFY(grandChild1->font().italic());
     QVERIFY(!grandChild1->font().bold());
@@ -1228,7 +1228,7 @@ void tst_QGraphicsWidget::layoutDirection()
     widget.setLayoutDirection(layoutDirection);
     QCOMPARE(widget.testAttribute(Qt::WA_SetLayoutDirection), true);
     view->show();
-    QTest::qWaitForWindowShown(view);
+    QVERIFY(QTest::qWaitForWindowExposed(view));
     for (int i = 0; i < children.count(); ++i) {
         QTRY_COMPARE(children[i]->layoutDirection(), layoutDirection);
         QTRY_COMPARE(children[i]->testAttribute(Qt::WA_SetLayoutDirection), false);
@@ -1501,8 +1501,8 @@ void tst_QGraphicsWidget::setTabOrderAndReparent()
     QGraphicsView view(&scene);
     view.show();
     QApplication::setActiveWindow(&view);
-    QTest::qWaitForWindowShown(&view);
-    QTRY_COMPARE(QApplication::activeWindow(), (QWidget*)&view);
+    QVERIFY(QTest::qWaitForWindowActive(&view));
+    QCOMPARE(QApplication::activeWindow(), (QWidget*)&view);
 
     int i;
     QGraphicsWidget *w1, *w2, *w3, *w4;
@@ -2623,7 +2623,7 @@ void tst_QGraphicsWidget::painterStateProtectionOnWindowFrame()
     QGraphicsView view(&scene);
     scene.addItem(widget);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 }
 
 class ProxyStyle : public QCommonStyle
@@ -2827,7 +2827,7 @@ void tst_QGraphicsWidget::ensureClipping()
     QGraphicsView view(&scene);
     view.setOptimizationFlag(QGraphicsView::IndirectPainting);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     QList<QGraphicsItem *> expected;
     expected << clipWidget << childWidget << childitem;
@@ -3033,7 +3033,7 @@ void tst_QGraphicsWidget::addChildInpolishEvent()
     QGraphicsView view(&scene);
     view.resize(200, 200);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     QTRY_COMPARE(PolishWidget::numberOfPolish, 2);
 }
 
@@ -3055,7 +3055,7 @@ void tst_QGraphicsWidget::polishEvent()
 
     QGraphicsView view(&scene);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     // Make sure the item is painted.
     QTRY_VERIFY(widget->events.contains(QEvent::Paint));
@@ -3233,7 +3233,7 @@ void tst_QGraphicsWidget::itemChangeEvents()
     QGraphicsWidget *parent = new QGraphicsWidget;
     scene.addItem(parent);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
 
     TestGraphicsWidget *item = new TestGraphicsWidget;
     item->setParentItem(parent);
@@ -3275,7 +3275,7 @@ void tst_QGraphicsWidget::itemSendGeometryPosChangesDeactivated()
     QGraphicsWidget *item = new QGraphicsWidget;
     scene.addItem(item);
     view.show();
-    QTest::qWaitForWindowShown(&view);
+    QVERIFY(QTest::qWaitForWindowExposed(&view));
     item->setGeometry(QRectF(0, 0, 50, 50));
     QTRY_COMPARE(item->geometry(), QRectF(0, 0, 50, 50));
 
index 610c0bc..2df89c0 100644 (file)
@@ -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)));
 
index bdcc46d..0d36da1 100644 (file)
@@ -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();
 
index 64aa571..d4531bc 100644 (file)
@@ -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;
index be2d49a..b0db1fe 100644 (file)
@@ -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();
index dd91e69..2ca2553 100644 (file)
@@ -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&)) );
 }
index 9c3be62..4536fa9 100644 (file)
@@ -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());
 
index e20111c..d21a447 100644 (file)
@@ -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);
index 5fba3f2..4daeb6c 100644 (file)
@@ -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);
 }
index c77358f..5148e0a 100644 (file)
@@ -166,7 +166,7 @@ void tst_QButtonGroup::arrowKeyNavigation()
 
     dlg.show();
     qApp->setActiveWindow(&dlg);
-    QTest::qWaitForWindowShown(&dlg);
+    QVERIFY(QTest::qWaitForWindowActive(&dlg));
 
     bt1.setFocus();
 
@@ -386,7 +386,7 @@ void tst_QButtonGroup::task106609()
     buttons->addButton(radio3, 3);
     vbox->addWidget(radio3);
     dlg.show();
-    QTest::qWaitForWindowShown(&dlg);
+    QVERIFY(QTest::qWaitForWindowExposed(&dlg));
 
     qRegisterMetaType<QAbstractButton*>("QAbstractButton*");
     QSignalSpy spy1(buttons, SIGNAL(buttonClicked(QAbstractButton*)));
index 1b48278..678dcff 100644 (file)
@@ -177,8 +177,8 @@ void tst_QCalendarWidget::buttonClickCheck()
     QSize size = object.sizeHint();
     object.setGeometry(0,0,size.width(), size.height());
     object.show();
-    QTest::qWaitForWindowShown(&object);
     object.activateWindow();
+    QVERIFY(QTest::qWaitForWindowActive(&object));
 
     QDate selectedDate(2005, 1, 1);
     //click on the month buttons
@@ -332,7 +332,7 @@ void tst_QCalendarWidget::showPrevNext()
 
     QCalendarWidget calWidget;
     calWidget.show();
-    QTest::qWaitForWindowShown(&calWidget);
+    QVERIFY(QTest::qWaitForWindowExposed(&calWidget));
     if(!dateOrigin.isNull()) {
         calWidget.setSelectedDate(dateOrigin);
         calWidget.setCurrentPage(dateOrigin.year(), dateOrigin.month());
index 96dce56..ba3cf13 100644 (file)
@@ -1977,7 +1977,7 @@ void tst_QComboBox::task190351_layout()
         list->addItem(QLatin1String("list") + QString::number(i));
 
     listCombo.show();
-    QTest::qWaitForWindowShown(&listCombo);
+    QVERIFY(QTest::qWaitForWindowExposed(&listCombo));
     QTRY_VERIFY(listCombo.isVisible());
     listCombo.setCurrentIndex(70);
     listCombo.showPopup();
@@ -2116,7 +2116,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize()
     comboBox.setGeometry(desktopSize.width() - (desktopSize.width() / 4), (desktopSize.width() / 4), (desktopSize.width() / 2), (desktopSize.width() / 4));
 
     comboBox.show();
-    QTest::qWaitForWindowShown(&comboBox);
+    QVERIFY(QTest::qWaitForWindowExposed(&comboBox));
     QTRY_VERIFY(comboBox.isVisible());
     comboBox.showPopup();
     QTRY_VERIFY(comboBox.view());
@@ -2436,8 +2436,8 @@ void tst_QComboBox::keyBoardNavigationWithMouse()
         combo.addItem( QString::number(i));
     combo.show();
     QApplication::setActiveWindow(&combo);
-    QTest::qWaitForWindowShown(&combo);
-    QTRY_COMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo));
+    QVERIFY(QTest::qWaitForWindowActive(&combo));
+    QCOMPARE(QApplication::activeWindow(), static_cast<QWidget *>(&combo));
 
     QCOMPARE(combo.currentText(), QLatin1String("0"));
 
@@ -2502,7 +2502,7 @@ void tst_QComboBox::task_QTBUG_1071_changingFocusEmitsActivated()
 
     w.show();
     QApplication::setActiveWindow(&w);
-    QTest::qWaitForWindowShown(&w);
+    QVERIFY(QTest::qWaitForWindowActive(&w));
     cb.clearEditText();
     cb.setFocus();
     QApplication::processEvents();
index ae776f5..6dd1f0d 100644 (file)
@@ -584,7 +584,7 @@ void tst_QCommandLinkButton::heightForWithWithIcon()
     layout->addStretch();
     mainWin.setLayout(layout);
     mainWin.showMaximized();
-    QTest::qWaitForWindowShown(&mainWin);
+    QVERIFY(QTest::qWaitForWindowExposed(&mainWin));
     QVERIFY(largeIconButton->height() > 68);  //enough room for the icon
 
 }
index 494ba54..018ddbd 100644 (file)
@@ -825,7 +825,7 @@ void tst_QDockWidget::taskQTBUG_1665_closableChanged()
 {
     QDockWidget dock;
     dock.show();
-    QTest::qWaitForWindowShown(&dock);
+    QVERIFY(QTest::qWaitForWindowExposed(&dock));
 
     QDockWidgetLayout *l = qobject_cast<QDockWidgetLayout*>(dock.layout());
 
@@ -850,10 +850,10 @@ void tst_QDockWidget::taskQTBUG_9758_undockedGeometry()
     dock1.hide();
     dock2.hide();
     window.show();
-    QTest::qWaitForWindowShown(&window);
+    QVERIFY(QTest::qWaitForWindowExposed(&window));
     dock1.setFloating(true);
     dock1.show();
-    QTest::qWaitForWindowShown(&dock1);
+    QVERIFY(QTest::qWaitForWindowExposed(&dock1));
 
     QVERIFY(dock1.x() >= 0);
     QVERIFY(dock1.y() >= 0);
index 19ff947..2f17f52 100644 (file)
@@ -403,7 +403,7 @@ void tst_QLabel::task226479_movieResize()
     label.show();
     QMovie *movie = new QMovie( &label );
     label.setMovie(movie);
-    QTest::qWaitForWindowShown(&label);
+    QVERIFY(QTest::qWaitForWindowExposed(&label));
     movie->setFileName(QFINDTESTDATA("red.png"));
     movie->start();
     QTest::qWait(50);
@@ -478,7 +478,7 @@ void tst_QLabel::unicodeText()
     layout->setMargin(8);
     frame.setLayout(layout);
     frame.show();
-    QTest::qWaitForWindowShown(&frame);
+    QVERIFY(QTest::qWaitForWindowExposed(&frame));
     QVERIFY(frame.isVisible());  // was successfully sized and shown
     testWidget->show();
 }
@@ -519,7 +519,7 @@ void tst_QLabel::mnemonic()
     hbox->addWidget(new QLineEdit);
     w.setLayout(hbox);
     w.show();
-    QTest::qWaitForWindowShown(&w);
+    QVERIFY(QTest::qWaitForWindowExposed(&w));
 
     QLabelPrivate *d = static_cast<QLabelPrivate *>(QObjectPrivate::get(lab));
     QVERIFY(d->control);
@@ -555,7 +555,7 @@ void tst_QLabel::taskQTBUG_7902_contextMenuCrash()
     QLabel *w = new QLabel("Test or crash?");
     w->setTextInteractionFlags(Qt::TextSelectableByMouse);
     w->show();
-    QTest::qWaitForWindowShown(w);
+    QVERIFY(QTest::qWaitForWindowExposed(w));
 
     QTimer ti;
     w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
index 48ff37a..956f970 100644 (file)
@@ -368,7 +368,7 @@ void tst_QLineEdit::initTestCase()
 
     testWidget->resize(200,50);
     testWidget->show();
-    QTest::qWaitForWindowShown(testWidget);
+    QVERIFY(QTest::qWaitForWindowExposed(testWidget));
     QApplication::setActiveWindow(testWidget);
     QTRY_VERIFY(testWidget->hasFocus());
 
@@ -3362,7 +3362,7 @@ void tst_QLineEdit::task174640_editingFinished()
     testMenu1->addAction("foo");
     testMenu1->addAction("bar");
     testMenu1->show();
-    QTest::qWaitForWindowShown(testMenu1);
+    QVERIFY(QTest::qWaitForWindowExposed(testMenu1));
     QTest::qWait(20);
     mw.activateWindow();
 
@@ -3374,7 +3374,7 @@ void tst_QLineEdit::task174640_editingFinished()
     testMenu2->addAction("foo2");
     testMenu2->addAction("bar2");
     testMenu2->show();
-    QTest::qWaitForWindowShown(testMenu2);
+    QVERIFY(QTest::qWaitForWindowExposed(testMenu2));
     QTest::qWait(20);
     mw.activateWindow();
     delete testMenu2;
@@ -3431,8 +3431,8 @@ void tst_QLineEdit::task210502_caseInsensitiveInlineCompletion()
     completer.setCompletionMode(QCompleter::InlineCompletion);
     lineEdit.setCompleter(&completer);
     lineEdit.show();
-    QTest::qWaitForWindowShown(&lineEdit);
     QApplication::setActiveWindow(&lineEdit);
+    QVERIFY(QTest::qWaitForWindowActive(&lineEdit));
     lineEdit.setFocus();
     QTRY_VERIFY(lineEdit.hasFocus());
     QTest::keyPress(&lineEdit, 'a');
@@ -3616,7 +3616,7 @@ void tst_QLineEdit::taskQTBUG_7902_contextMenuCrash()
     // Would pass before the associated commit, but left as a guard.
     QLineEdit *w = new QLineEdit;
     w->show();
-    QTest::qWaitForWindowShown(w);
+    QVERIFY(QTest::qWaitForWindowExposed(w));
 
     QTimer ti;
     w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));
@@ -3667,7 +3667,7 @@ void tst_QLineEdit::QTBUG697_paletteCurrentColorGroup()
 
     le.show();
     QApplication::setActiveWindow(&le);
-    QTest::qWaitForWindowShown(&le);
+    QVERIFY(QTest::qWaitForWindowActive(&le));
     le.setFocus();
     QTRY_VERIFY(le.hasFocus());
     le.selectAll();
@@ -3685,7 +3685,7 @@ void tst_QLineEdit::QTBUG13520_textNotVisible()
     LineEdit le;
     le.setAlignment( Qt::AlignRight | Qt::AlignVCenter);
     le.show();
-    QTest::qWaitForWindowShown(&le);
+    QVERIFY(QTest::qWaitForWindowExposed(&le));
     le.setText("01-ST16-01SIL-MPL001wfgsdfgsdgsdfgsdfgsdfgsdfgsdfg");
     le.setCursorPosition(0);
     QTest::qWait(100); //just make sure we get he lineedit correcly painted
@@ -3714,7 +3714,7 @@ void tst_QLineEdit::QTBUG7174_inputMaskCursorBlink()
     edit.setText(QLatin1String("AAAA"));
     edit.show();
     QRect cursorRect = edit.inputMethodQuery(Qt::ImMicroFocus).toRect();
-    QTest::qWaitForWindowShown(&edit);
+    QVERIFY(QTest::qWaitForWindowExposed(&edit));
     edit.updateRegion = QRegion();
     QTest::qWait(QApplication::cursorFlashTime());
     QVERIFY(edit.updateRegion.contains(cursorRect));
index c6a039c..6dc049b 100644 (file)
@@ -1684,7 +1684,7 @@ void tst_QMainWindow::QTBUG2774_stylechange()
     mw.setCentralWidget(central);
     dockw->resize(10,10);
     mw.show();
-    QTest::qWaitForWindowShown(&mw);
+    QVERIFY(QTest::qWaitForWindowExposed(&mw));
     int centralOriginalWidth = central->width();
 
     QVERIFY(!mw.isSeparator(QPoint(4, dockw->pos().y() + dockw->size().height() - 3)));
index 0a66571..a6880bc 100644 (file)
@@ -636,7 +636,7 @@ void tst_QMdiArea::changeWindowTitle()
     mw->setCentralWidget( ws );
     mw->menuBar();
     mw->show();
-    QTest::qWaitForWindowShown(mw);
+    QVERIFY(QTest::qWaitForWindowExposed(mw));
 
     QWidget *widget = new QWidget( ws );
     widget->setWindowTitle( wc );
@@ -656,8 +656,7 @@ void tst_QMdiArea::changeWindowTitle()
     mw->hide();
     qApp->processEvents();
     mw->show();
-    qApp->processEvents();
-    QTest::qWaitForWindowShown(mw);
+    QVERIFY(QTest::qWaitForWindowExposed(mw));
 
 #if !defined(Q_OS_MAC) && !defined(Q_OS_WINCE)
     QTRY_COMPARE( mw->windowTitle(), QString::fromLatin1("%1 - [%2]").arg(mwc).arg(wc) );
index 98a3675..614bb15 100644 (file)
@@ -985,7 +985,7 @@ void tst_QMdiSubWindow::setSystemMenu()
     mainWindow.setCentralWidget(mdiArea);
     mainWindow.menuBar();
     mainWindow.show();
-    QTest::qWaitForWindowShown(&mainWindow);
+    QVERIFY(QTest::qWaitForWindowExposed(&mainWindow));
     QTest::qWait(60);
 
 
@@ -1626,7 +1626,7 @@ void tst_QMdiSubWindow::resizeTimer()
     QMdiArea mdiArea;
     QMdiSubWindow *subWindow = mdiArea.addSubWindow(new QWidget);
     mdiArea.show();
-    QTest::qWaitForWindowShown(&mdiArea);
+    QVERIFY(QTest::qWaitForWindowExposed(&mdiArea));
     QTest::qWait(300);
 
 
index 40985c0..a61e34f 100644 (file)
@@ -429,10 +429,10 @@ void tst_QMenu::overrideMenuAction()
     m->addAction(aQuit);
 
     w.show();
-    QTest::qWaitForWindowShown(&w);
     QApplication::setActiveWindow(&w);
     w.setFocus();
-    QTRY_VERIFY(w.hasFocus());
+    QVERIFY(QTest::qWaitForWindowActive(&w));
+    QVERIFY(w.hasFocus());
 
     //test of the action inside the menu
     QTest::keyClick(&w, Qt::Key_X, Qt::ControlModifier);
@@ -467,7 +467,7 @@ void tst_QMenu::statusTip()
 
     w.addToolBar(&tb);
     w.show();
-    QTest::qWaitForWindowShown(&w);
+    QVERIFY(QTest::qWaitForWindowExposed(&w));
 
     QRect rect1 = tb.actionGeometry(&a);
     QToolButton *btn = qobject_cast<QToolButton*>(tb.childAt(rect1.center()));
@@ -583,20 +583,20 @@ void tst_QMenu::layoutDirection()
 
     QMenu menu(&win);
     menu.show();
-    QTest::qWaitForWindowShown(&menu);
+    QVERIFY(QTest::qWaitForWindowExposed(&menu));
     QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
     menu.close();
 
     menu.setParent(0);
     menu.show();
-    QTest::qWaitForWindowShown(&menu);
+    QVERIFY(QTest::qWaitForWindowExposed(&menu));
     QCOMPARE(menu.layoutDirection(), QApplication::layoutDirection());
     menu.close();
 
     //now the menubar
     QAction *action = win.menuBar()->addMenu(&menu);
     win.menuBar()->setActiveAction(action);
-    QTest::qWaitForWindowShown(&menu);
+    QVERIFY(QTest::qWaitForWindowExposed(&menu));
     QCOMPARE(menu.layoutDirection(), Qt::RightToLeft);
 }
 
@@ -784,7 +784,7 @@ void tst_QMenu::task258920_mouseBorder()
     QAction *action = menu.addAction("test");
 
     menu.popup(QApplication::desktop()->availableGeometry().center());
-    QTest::qWaitForWindowShown(&menu);
+    QVERIFY(QTest::qWaitForWindowExposed(&menu));
     QTest::qWait(100);
     QRect actionRect = menu.actionGeometry(action);
     QTest::mouseMove(&menu, actionRect.center());
@@ -834,7 +834,7 @@ void tst_QMenu::pushButtonPopulateOnAboutToShow()
     desiredGeometry.moveTopLeft(QPoint(10, screen.bottom()-b.height()-5));
 
     b.setGeometry(desiredGeometry);
-    QTest::qWaitForWindowShown(&b);
+    QVERIFY(QTest::qWaitForWindowExposed(&b));
 
     if (b.geometry() != desiredGeometry) {
         // We are trying to put the button very close to the edge of the screen,
@@ -868,7 +868,7 @@ void tst_QMenu::QTBUG7907_submenus_autoselect()
     menu.addMenu(&set1);
     menu.addMenu(&set2);
     menu.show();
-    QTest::qWaitForWindowShown(&menu);
+    QVERIFY(QTest::qWaitForWindowExposed(&menu));
     QTest::mouseClick(&menu, Qt::LeftButton, Qt::NoModifier, QPoint(5,5) );
     QTest::qWait(500);
     QVERIFY(!subset.isVisible());
@@ -883,7 +883,7 @@ void tst_QMenu::QTBUG7411_submenus_activate()
     sub1.setTitle("&sub1");
     QAction *act1 = menu.addMenu(&sub1);
     menu.show();
-    QTest::qWaitForWindowShown(&menu);
+    QVERIFY(QTest::qWaitForWindowExposed(&menu));
     menu.setActiveAction(act);
     QTest::keyPress(&menu, Qt::Key_Down);
     QCOMPARE(menu.activeAction(), act1);
@@ -906,7 +906,7 @@ public:
     {
         m_currentIndex = index;
         popup(QPoint());
-        QTest::qWaitForWindowShown(this);
+        QVERIFY(QTest::qWaitForWindowExposed(this));
         setActiveAction(dialogActions[index]);
         QTimer::singleShot(500, this, SLOT(checkVisibility()));
         QTest::keyClick(this, Qt::Key_Enter); //activation
index 5a2cf0f..a9590ca 100644 (file)
@@ -241,8 +241,8 @@ void tst_QMenuBar::initTestCase()
 
     initSimpleMenubar();
     mw->show();
-    QTest::qWaitForWindowShown(mw);
     mw->activateWindow();
+    QVERIFY(QTest::qWaitForWindowActive(mw));
 
     menu1 = new QtTestSlot( mw );
     menu2 = new QtTestSlot( mw );
@@ -1239,11 +1239,11 @@ void tst_QMenuBar::taskQTBUG4965_escapeEaten()
     menu.addAction("quit", &menubar, SLOT(close()), QKeySequence("ESC"));
     menubar.show();
     QApplication::setActiveWindow(&menubar);
-    QTest::qWaitForWindowShown(&menubar);
+    QVERIFY(QTest::qWaitForWindowExposed(&menubar));
     menubar.setActiveAction(first);
     QTRY_VERIFY(menu.isVisible());
     QCOMPARE(menubar.activeAction(), first);
-    QTest::qWaitForWindowShown(&menu);
+    QVERIFY(QTest::qWaitForWindowExposed(&menu));
     QTest::keyClick(static_cast<QWidget *>(0), Qt::Key_Escape);
     QVERIFY(!menu.isVisible());
     QTRY_VERIFY(menubar.hasFocus());
index 84e3acb..f560b6a 100644 (file)
@@ -165,7 +165,7 @@ void tst_QProgressBar::format()
     bar.setRange(0, 10);
     bar.setValue(1);
     bar.show();
-    QTest::qWaitForWindowShown(&bar);
+    QVERIFY(QTest::qWaitForWindowExposed(&bar));
 
     QTest::qWait(20);
     bar.repainted = false;
@@ -201,7 +201,7 @@ void tst_QProgressBar::setValueRepaint()
     pbar.setMaximum(10);
     pbar.setFormat("%v");
     pbar.show();
-    QTest::qWaitForWindowShown(&pbar);
+    QVERIFY(QTest::qWaitForWindowExposed(&pbar));
 
     QApplication::processEvents();
     for (int i = pbar.minimum(); i < pbar.maximum(); ++i) {
index 13da443..32b7ffe 100644 (file)
@@ -746,7 +746,7 @@ void tst_QSpinBox::editingFinished()
 
     testFocusWidget->show();
     QApplication::setActiveWindow(testFocusWidget);
-    QTest::qWaitForWindowShown(testFocusWidget);
+    QVERIFY(QTest::qWaitForWindowActive(testFocusWidget));
     box->activateWindow();
     box->setFocus();
 
@@ -971,7 +971,7 @@ void tst_QSpinBox::sizeHint()
     sizeHint_SpinBox *spinBox = new sizeHint_SpinBox;
     layout->addWidget(spinBox);
     widget->show();
-    QTest::qWaitForWindowShown(widget);
+    QVERIFY(QTest::qWaitForWindowExposed(widget));
 
     // Prefix
     spinBox->sizeHintRequests = 0;
@@ -1023,8 +1023,8 @@ void tst_QSpinBox::taskQTBUG_5008_textFromValueAndValidate()
     spinbox.activateWindow();
     spinbox.setFocus();
     QApplication::setActiveWindow(&spinbox);
-    QTest::qWaitForWindowShown(&spinbox);
-    QTRY_VERIFY(spinbox.hasFocus());
+    QVERIFY(QTest::qWaitForWindowActive(&spinbox));
+    QVERIFY(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
index 0757dd9..50536c8 100644 (file)
@@ -644,7 +644,7 @@ void tst_QTabBar::taskQTBUG_10052_widgetLayoutWhenMoving()
     tabBar.setTabButton(1, QTabBar::RightSide, &w2);
 
     tabBar.show();
-    QTest::qWaitForWindowShown(&tabBar);
+    QVERIFY(QTest::qWaitForWindowExposed(&tabBar));
     w1.moved = w2.moved = false;
     tabBar.moveTab(0, 1);
     QTRY_VERIFY(w1.moved);
index d68e2ad..350df08 100644 (file)
@@ -612,7 +612,7 @@ void tst_QTabWidget::minimumSizeHint()
     tw.addTab(page, QLatin1String("page1"));
 
     tw.show();
-    QTest::qWaitForWindowShown(&tw);
+    QVERIFY(QTest::qWaitForWindowExposed(&tw));
     tw.resize(tw.minimumSizeHint());
 
     QSize minSize = label->minimumSizeHint();
@@ -660,7 +660,7 @@ void tst_QTabWidget::heightForWidth()
     window->resize(160, h);
     window->show();
 
-    QTest::qWaitForWindowShown(window);
+    QVERIFY(QTest::qWaitForWindowExposed(window));
     QVERIFY(label->height() >= label->heightForWidth(label->width()));
 
     delete window;
index e539224..0d04f69 100644 (file)
@@ -55,11 +55,10 @@ public:
     inline TestBrowser() : htmlLoadAttempts(0) {
         show();
         QApplication::setActiveWindow(this);
-        QTest::qWaitForWindowShown(this);
         activateWindow();
         setFocus();
-        QTest::qWait(50);
-        QTRY_VERIFY(hasFocus());
+        QVERIFY(QTest::qWaitForWindowActive(this));
+        QVERIFY(hasFocus());
     }
 
     virtual QVariant loadResource(int type, const QUrl &name);
index f14c4e0..846bb41 100644 (file)
@@ -2236,7 +2236,7 @@ void tst_QTextEdit::taskQTBUG_7902_contextMenuCrash()
 {
     QTextEdit *w = new QTextEdit;
     w->show();
-    QTest::qWaitForWindowShown(w);
+    QVERIFY(QTest::qWaitForWindowExposed(w));
 
     QTimer ti;
     w->connect(&ti, SIGNAL(timeout()), w, SLOT(deleteLater()));