summaryrefslogtreecommitdiff
path: root/tests/auto/qlistview/tst_qlistview.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-09-07 12:49:07 +0200
committerOlivier Goffart <ogoffart@trolltech.com>2009-09-07 12:51:21 +0200
commit3a275174d9a61f7f6451b1da39da82fd8286f9f7 (patch)
tree07a070c52ef516a7d871225d71f22071d44334b1 /tests/auto/qlistview/tst_qlistview.cpp
parentc4c9b4457f0f760c1bf46dd8a309ab76eb128c1d (diff)
downloadqt4-tools-3a275174d9a61f7f6451b1da39da82fd8286f9f7.tar.gz
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/auto/qlistview/tst_qlistview.cpp')
-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 c598aeb3df..2be1a039e2 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);
}