QtWidgets tests: Don't use the deprecated QTest::qWaitForWindowShown()

Change-Id: I2dd5a54f9485591ca2dab65f7a352ef453c185e2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Debao Zhang 2013-03-25 17:40:59 +08:00 committed by The Qt Project
parent 90d74f8602
commit 1fb3d56efb
6 changed files with 8 additions and 8 deletions

View File

@ -3025,7 +3025,7 @@ void tst_QGraphicsView::task187791_setSceneCausesUpdate()
QGraphicsView view(&scene); QGraphicsView view(&scene);
view.show(); view.show();
qApp->setActiveWindow(&view); qApp->setActiveWindow(&view);
QVERIFY(QTest::qWaitForWindowShown(&view)); QVERIFY(QTest::qWaitForWindowExposed(&view));
EventSpy updateSpy(view.viewport(), QEvent::Paint); EventSpy updateSpy(view.viewport(), QEvent::Paint);
QCOMPARE(updateSpy.count(), 0); QCOMPARE(updateSpy.count(), 0);

View File

@ -2207,7 +2207,7 @@ void tst_QListView::taskQTBUG_21804_hiddenItemsAndScrollingWithKeys()
lv.setSpacing(spacing); lv.setSpacing(spacing);
lv.setModel(&model); lv.setModel(&model);
lv.show(); lv.show();
QTest::qWaitForWindowShown(&lv); QTest::qWaitForWindowExposed(&lv);
// hide every odd number row // hide every odd number row
for (int i = 1; i < model.rowCount(); i+=2) for (int i = 1; i < model.rowCount(); i+=2)
@ -2283,7 +2283,7 @@ void tst_QListView::spacing()
lv.setModel(&model); lv.setModel(&model);
lv.setSpacing(spacing); lv.setSpacing(spacing);
lv.show(); lv.show();
QTest::qWaitForWindowShown(&lv); QTest::qWaitForWindowExposed(&lv);
// check size and position of first two items // check size and position of first two items
QRect item1 = lv.visualRect(lv.model()->index(0, 0)); QRect item1 = lv.visualRect(lv.model()->index(0, 0));

View File

@ -4255,7 +4255,7 @@ void tst_QTreeView::quickExpandCollapse()
QVERIFY(rootIndex.isValid()); QVERIFY(rootIndex.isValid());
tree.show(); tree.show();
QTest::qWaitForWindowShown(&tree); QTest::qWaitForWindowExposed(&tree);
int initialState = tree.state(); int initialState = tree.state();

View File

@ -7019,7 +7019,7 @@ void tst_QWidget::moveWindowInShowEvent()
// show it // show it
widget.show(); widget.show();
QVERIFY(QTest::qWaitForWindowShown(&widget)); QVERIFY(QTest::qWaitForWindowExposed(&widget));
QTest::qWait(100); QTest::qWait(100);
// it should have moved // it should have moved
QCOMPARE(widget.pos(), position); QCOMPARE(widget.pos(), position);

View File

@ -2059,7 +2059,7 @@ void tst_QComboBox::task190351_layout()
listCombo.setCurrentIndex(70); listCombo.setCurrentIndex(70);
listCombo.showPopup(); listCombo.showPopup();
QTRY_VERIFY(listCombo.view()); QTRY_VERIFY(listCombo.view());
QTest::qWaitForWindowShown(listCombo.view()); QTest::qWaitForWindowExposed(listCombo.view());
QTRY_VERIFY(listCombo.view()->isVisible()); QTRY_VERIFY(listCombo.view()->isVisible());
QApplication::processEvents(); QApplication::processEvents();
@ -2197,7 +2197,7 @@ void tst_QComboBox::task248169_popupWithMinimalSize()
QTRY_VERIFY(comboBox.isVisible()); QTRY_VERIFY(comboBox.isVisible());
comboBox.showPopup(); comboBox.showPopup();
QTRY_VERIFY(comboBox.view()); QTRY_VERIFY(comboBox.view());
QTest::qWaitForWindowShown(comboBox.view()); QTest::qWaitForWindowExposed(comboBox.view());
QTRY_VERIFY(comboBox.view()->isVisible()); QTRY_VERIFY(comboBox.view()->isVisible());
#ifdef QT_BUILD_INTERNAL #ifdef QT_BUILD_INTERNAL

View File

@ -659,7 +659,7 @@ void tst_QPushButton::taskQTBUG_20191_shortcutWithKeypadModifer()
QDialog dialog; QDialog dialog;
dialog.setLayout(layout); dialog.setLayout(layout);
dialog.show(); dialog.show();
QTest::qWaitForWindowShown(&dialog); QTest::qWaitForWindowExposed(&dialog);
QApplication::setActiveWindow(&dialog); QApplication::setActiveWindow(&dialog);
// add shortcut '5' to button1 and test with keyboard and keypad '5' keys // add shortcut '5' to button1 and test with keyboard and keypad '5' keys