summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-07 10:49:07 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-07 10:51:21 (GMT)
commit3a275174d9a61f7f6451b1da39da82fd8286f9f7 (patch)
tree07a070c52ef516a7d871225d71f22071d44334b1 /tests
parentc4c9b4457f0f760c1bf46dd8a309ab76eb128c1d (diff)
downloadQt-3a275174d9a61f7f6451b1da39da82fd8286f9f7.zip
Qt-3a275174d9a61f7f6451b1da39da82fd8286f9f7.tar.gz
Qt-3a275174d9a61f7f6451b1da39da82fd8286f9f7.tar.bz2
Fix tst_QListView::task254449_draggingItemToNegativeCoordinates on Mac
On Mac, QWidget::repaint() is the same thing as update(), it needs to reenter the event loop to get processed (this has always been like that)
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qlistview/tst_qlistview.cpp20
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp
index c598aeb..2be1a03 100644
--- a/tests/auto/qlistview/tst_qlistview.cpp
+++ b/tests/auto/qlistview/tst_qlistview.cpp
@@ -1614,13 +1614,6 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates()
list.setModel(&model);
list.setViewMode(QListView::IconMode);
list.show();
- QTest::qWait(200); //makes sure the layout is done
-
- const QPoint topLeft(-6, 0);
-
-
- list.setPositionForIndex(topLeft, index);
-
class MyItemDelegate : public QStyledItemDelegate
{
public:
@@ -1634,15 +1627,18 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates()
mutable int numPaints;
} delegate;
-
list.setItemDelegate(&delegate);
+ QTest::qWait(200); //makes sure the layout is done
+
+ const QPoint topLeft(-6, 0);
+ list.setPositionForIndex(topLeft, index);
+
//we'll make sure the item is repainted
delegate.numPaints = 0;
- list.viewport()->repaint();
-
- QCOMPARE(list.visualRect(index).topLeft(), topLeft);
- QCOMPARE(delegate.numPaints, 1);
+ QApplication::processEvents();
+ QCOMPARE(list.visualRect(index).topLeft(), topLeft);
+ QCOMPARE(delegate.numPaints, 1);
}