From 5af79b7efd66ff2ce014cb480d27f768ffa19215 Mon Sep 17 00:00:00 2001 From: Thierry Bastian Date: Thu, 1 Oct 2009 14:09:28 +0200 Subject: Try to fix autotest Also improves a bit the quality of the code by sending the event instead of calling directly the event handler --- tests/auto/qtableview/tst_qtableview.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp index 71218a3..59e80c5 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); } -- cgit v0.12