diff options
Diffstat (limited to 'tests/auto/qtableview/tst_qtableview.cpp')
-rw-r--r-- | tests/auto/qtableview/tst_qtableview.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index dbf1aa4..ce13d31 100644 --- a/tests/auto/qtableview/tst_qtableview.cpp +++ b/tests/auto/qtableview/tst_qtableview.cpp @@ -586,13 +586,13 @@ void tst_QTableView::keyboardNavigation() QTableView view; view.setModel(&model); - view.show(); view.setTabKeyNavigation(tabKeyNavigation); - QModelIndex index = model.index(rowCount - 1, columnCount - 1); view.setCurrentIndex(index); - QApplication::processEvents(); + view.show(); + QTest::qWaitForWindowShown(&view); + qApp->setActiveWindow(&view); int row = rowCount - 1; int column = columnCount - 1; @@ -2908,10 +2908,7 @@ void tst_QTableView::tabFocus() QLineEdit *edit = new QLineEdit(&window); window.show(); -//wait for window manager: -#ifdef Q_WS_QWS - qApp->processEvents(); -#endif + QTest::qWaitForWindowShown(&window); window.setFocus(); QTest::qWait(100); window.activateWindow(); @@ -3051,7 +3048,7 @@ void tst_QTableView::selectionSignal() view.setModel(&model); view.resize(200, 200); view.show(); - WAIT_FOR_CONDITION(view.isVisible(), true); + QTest::qWaitForWindowShown(&view); QTest::mouseClick(view.viewport(), Qt::LeftButton, 0, view.visualRect(model.index(2, 0)).center()); } @@ -3084,10 +3081,7 @@ void tst_QTableView::task173773_updateVerticalHeader() view.setModel(&proxyModel); view.setSortingEnabled(true); view.show(); -#ifdef Q_WS_X11 - qt_x11_wait_for_window_manager(&view); -#endif - QTest::qWait(100); + QTest::qWaitForWindowShown(&view); view.sortByColumn(0, Qt::AscendingOrder); QTest::qWait(100); @@ -3152,7 +3146,7 @@ void tst_QTableView::task240266_veryBigColumn() table.setColumnWidth(1, 100); //normal column table.setColumnWidth(2, 9000); //very big column table.show(); - QTest::qWait(100); + QTest::qWaitForWindowShown(&table); //some styles change the scroll mode in their polish table.setHorizontalScrollMode(QAbstractItemView::ScrollPerItem); @@ -3287,7 +3281,7 @@ void tst_QTableView::task259308_scrollVerticalHeaderSwappedSections() tv.verticalHeader()->swapSections(0, model.rowCount() - 1); tv.setCurrentIndex(model.index(model.rowCount() - 1, 0)); - QTest::qWait(60); + QTest::qWaitForWindowShown(&tv); QTest::keyClick(&tv, Qt::Key_PageUp); // PageUp won't scroll when at top QTRY_COMPARE(tv.rowAt(0), tv.verticalHeader()->logicalIndex(0)); |