summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtableview
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-11-17 15:20:28 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2009-11-17 15:23:40 (GMT)
commit39463ccddd6f8c071da90e995ba5e76518738f94 (patch)
tree25e1dc1d894bdffbc2258fc171f5c4f31cce02f5 /tests/auto/qtableview
parentb914ba0d4dc1bc1e125fecde28c1be6a7ef90bb5 (diff)
downloadQt-39463ccddd6f8c071da90e995ba5e76518738f94.zip
Qt-39463ccddd6f8c071da90e995ba5e76518738f94.tar.gz
Qt-39463ccddd6f8c071da90e995ba5e76518738f94.tar.bz2
Mouse wheel wouldn't scroll the itemview when over header views
The mouse wheel event was not being relayed to the parent (supposedly QAbstractScrollArea) widget. Auto-test included. Reviewed-by: Olivier Task-number: QTBUG-5237
Diffstat (limited to 'tests/auto/qtableview')
-rw-r--r--tests/auto/qtableview/tst_qtableview.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/qtableview/tst_qtableview.cpp b/tests/auto/qtableview/tst_qtableview.cpp
index f571e8a..33c7067 100644
--- a/tests/auto/qtableview/tst_qtableview.cpp
+++ b/tests/auto/qtableview/tst_qtableview.cpp
@@ -198,6 +198,7 @@ private slots:
void task191545_dragSelectRows();
void taskQTBUG_5062_spansInconsistency();
void taskQTBUG_4516_clickOnRichTextLabel();
+ void taskQTBUG_5237_wheelEventOnHeader();
void mouseWheel_data();
void mouseWheel();
@@ -3922,6 +3923,22 @@ void tst_QTableView::changeHeaderData()
QVERIFY(view.verticalHeader()->width() > textWidth);
}
+void tst_QTableView::taskQTBUG_5237_wheelEventOnHeader()
+{
+ QTableView view;
+ QStandardItemModel model(500,5);
+ view.setModel(&model);
+ view.show();
+ QTest::qWaitForWindowShown(&view);
+
+ int sbValueBefore = view.verticalScrollBar()->value();
+ QHeaderView *header = view.verticalHeader();
+ QTest::mouseMove(header);
+ QWheelEvent wheelEvent(header->geometry().center(), -720, 0, 0);
+ QApplication::sendEvent(header->viewport(), &wheelEvent);
+ int sbValueAfter = view.verticalScrollBar()->value();
+ QVERIFY(sbValueBefore != sbValueAfter);
+}
QTEST_MAIN(tst_QTableView)
#include "tst_qtableview.moc"