summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtableview
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-09-18 15:53:20 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-09-18 15:55:36 (GMT)
commitdf1a702e53026f9767b36b4419b0c6ecdc1e54cd (patch)
treebd9c16cbd6f63af42c4fd47f26013c54acdafa5f /tests/auto/qtableview
parent0d9e785fdf770ffee8e72c92091aa55176437154 (diff)
downloadQt-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.cpp22
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));