diff options
author | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-09-18 15:53:20 (GMT) |
---|---|---|
committer | Denis Dzyubenko <denis.dzyubenko@nokia.com> | 2009-09-18 15:55:36 (GMT) |
commit | df1a702e53026f9767b36b4419b0c6ecdc1e54cd (patch) | |
tree | bd9c16cbd6f63af42c4fd47f26013c54acdafa5f /tests/auto/qtableview | |
parent | 0d9e785fdf770ffee8e72c92091aa55176437154 (diff) | |
download | Qt-df1a702e53026f9767b36b4419b0c6ecdc1e54cd.zip Qt-df1a702e53026f9767b36b4419b0c6ecdc1e54cd.tar.gz Qt-df1a702e53026f9767b36b4419b0c6ecdc1e54cd.tar.bz2 |
Small improvements to some autotests.
This should improve qgraphicsview, qgraphicsitem and qtableview
autotests on slow window managers on X11.
Reviewed-by: trustme
Diffstat (limited to 'tests/auto/qtableview')
-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)); |