summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtableview
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-01 14:09:28 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-01 14:13:46 +0200
commit5af79b7efd66ff2ce014cb480d27f768ffa19215 (patch)
treeb7d1dae8c701d0f0d743bd6ce17239632e79334d /tests/auto/qtableview
parent072e748adbdab1d51b240b9983ce82b213b66f18 (diff)
Try to fix autotest
Also improves a bit the quality of the code by sending the event instead of calling directly the event handler
Diffstat (limited to 'tests/auto/qtableview')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index 71218a3523..59e80c562a 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -378,7 +378,6 @@ public:
}
bool checkSignalOrder;
- using QTableView::wheelEvent;
public slots:
void currentChanged(QModelIndex , QModelIndex ) {
hasCurrentChanged++;
@@ -3222,6 +3221,7 @@ void tst_QTableView::mouseWheel()
for (int c = 0; c < 100; ++c)
view.setColumnWidth(c, 100);
view.show();
+ QTest::qWaitForWindowShown(view);
view.setModel(&model);
@@ -3230,12 +3230,13 @@ void tst_QTableView::mouseWheel()
view.horizontalScrollBar()->setValue(10);
view.verticalScrollBar()->setValue(10);
- QPoint pos(100,100);
+ qDebug() << "delta" << delta << view.viewport()->geometry();
+ QPoint pos = view.viewport()->geometry().center();
QWheelEvent verticalEvent(pos, delta, 0, 0, Qt::Vertical);
QWheelEvent horizontalEvent(pos, delta, 0, 0, Qt::Horizontal);
- view.wheelEvent(&horizontalEvent);
+ QApplication::sendEvent(view.viewport(), &horizontalEvent);
QVERIFY(qAbs(view.horizontalScrollBar()->value() - horizontalPositon) < 10);
- view.wheelEvent(&verticalEvent);
+ QApplication::sendEvent(view.viewport(), &verticalEvent);
QVERIFY(qAbs(view.verticalScrollBar()->value() - verticalPosition) < 10);
}