summaryrefslogtreecommitdiffstats
path: root/tests/auto/qabstractitemview
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-07-01 10:22:15 +0200
committerThierry Bastian <thierry.bastian@nokia.com>2009-07-01 10:23:52 +0200
commit9cb231d773db6deb8fb145eb40aa949a2758d002 (patch)
tree40b5e699d6770175084a5e785405d5f3a1f6af8a /tests/auto/qabstractitemview
parent96850fcb6462736dabfc368c85a208cb92851fac (diff)
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.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qabstractitemview/tst_qabstractitemview.cpp b/tests/auto/qabstractitemview/tst_qabstractitemview.cpp
index c117aa4fc4..0bc459e328 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"