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>
This commit is contained in:
Miikka Heikkinen 2012-05-31 11:58:18 +03:00 committed by Qt by Nokia
parent 2a5ec0403c
commit 32fa7a5410

View File

@ -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.