summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2012-05-31 11:58:18 +0300
committerQt by Nokia <qt-info@nokia.com>2012-06-01 01:21:17 +0200
commit32fa7a54103eef9da9f6eb75274c4ff15793ea44 (patch)
tree31e7ce9191a12563c13bfc5483f44a7fbf2881ad /tests/auto
parent2a5ec0403c9c79239c3a5c3657e0a73948df9227 (diff)
Fix tst_qlistwidget::fastScroll test case
tst_qlistwidget::fastScroll fails if the mouse cursor happens to be over the tested widget, because that causes an item to highlight, resulting in unexpected region of widget to be painted. Fixed by forcing the mouse cursor off the widget before the test. Task-number: QTBUG-24299 Change-Id: I8f45541feda44681179d43eda67d970d5fea4e40 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
index afc24cd493..9407fe0856 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
+++ b/tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp
@@ -1515,6 +1515,11 @@ void tst_QListWidget::fastScroll()
topLevel.resize(300, 300); // toplevel needs to be wide enough for the item
topLevel.show();
+
+ // Force the mouse cursor off the widget as it causes item it is over to highlight,
+ // which causes unexpected paint region.
+ QTest::mouseMove(&widget, QPoint(-10, -10));
+
// Make sure the widget gets the first full repaint. On
// some WMs, we'll get two (first inactive exposure, then
// active exposure.