From 3a275174d9a61f7f6451b1da39da82fd8286f9f7 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 7 Sep 2009 12:49:07 +0200 Subject: 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) --- tests/auto/qlistview/tst_qlistview.cpp | 20 ++++++++------------ 1 file 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); } -- cgit v0.12