diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-01 08:22:15 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-07-01 08:23:52 (GMT) |
commit | 9cb231d773db6deb8fb145eb40aa949a2758d002 (patch) | |
tree | 40b5e699d6770175084a5e785405d5f3a1f6af8a /tests/auto/qabstractitemview | |
parent | 96850fcb6462736dabfc368c85a208cb92851fac (diff) | |
download | Qt-9cb231d773db6deb8fb145eb40aa949a2758d002.zip Qt-9cb231d773db6deb8fb145eb40aa949a2758d002.tar.gz Qt-9cb231d773db6deb8fb145eb40aa949a2758d002.tar.bz2 |
ItemViews: Fixed signal entered not being emitted when using the mouse
wheel
The solution is to check the the current "entered item" hasn't change
also when the scrollbars change values
Task-number: 200665
Reviewed-by: janarve
Diffstat (limited to 'tests/auto/qabstractitemview')
-rw-r--r-- | tests/auto/qabstractitemview/tst_qabstractitemview.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp index c117aa4..0bc459e 100644 --- a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp +++ b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp @@ -212,6 +212,7 @@ private slots: void task221955_selectedEditor(); void task250754_fontChange(); + void task200665_itemEntered(); }; class MyAbstractItemDelegate : public QAbstractItemDelegate @@ -1199,5 +1200,23 @@ void tst_QAbstractItemView::task250754_fontChange() qApp->setStyleSheet(app_css); } +void tst_QAbstractItemView::task200665_itemEntered() +{ + //we test that view will emit entered + //when the scrollbar move but not the mouse itself + QStandardItemModel model(1000,1); + QListView view; + view.setModel(&model); + view.show(); + QTest::qWait(200); + QRect rect = view.visualRect(model.index(0,0)); + QCursor::setPos( view.viewport()->mapToGlobal(rect.center()) ); + QSignalSpy spy(&view, SIGNAL(entered(QModelIndex))); + view.verticalScrollBar()->setValue(view.verticalScrollBar()->maximum()); + QCOMPARE(spy.count(), 1); + +} + + QTEST_MAIN(tst_QAbstractItemView) #include "tst_qabstractitemview.moc" |