diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-05 12:13:53 (GMT) |
---|---|---|
committer | Jason McDonald <jason.mcdonald@nokia.com> | 2009-10-06 02:53:30 (GMT) |
commit | 105f17800e4a12e12d728f6f319ebbe9be7fd433 (patch) | |
tree | febe7325786ee28306f44daf3ea24ba621e54cc0 /tests | |
parent | fd8fda4db4446e394db137ce572a9f2508d12bf2 (diff) | |
download | Qt-105f17800e4a12e12d728f6f319ebbe9be7fd433.zip Qt-105f17800e4a12e12d728f6f319ebbe9be7fd433.tar.gz Qt-105f17800e4a12e12d728f6f319ebbe9be7fd433.tar.bz2 |
QAbstractItemView: Make sure the view is updated when a delegate is set.
The test tst_QListView::task254449_draggingItemToNegativeCoordinates was failing
in cocoa because of this. (on, cocoa, the call to show was doing the first paintEvent)
Reviewed-by: Thierry
(cherry picked from commit e1fbf1e016cbbf203964f3606ee2a34afe33bbd7)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qlistview/tst_qlistview.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/qlistview/tst_qlistview.cpp b/tests/auto/qlistview/tst_qlistview.cpp index d9cab02..cba1776 100644 --- a/tests/auto/qlistview/tst_qlistview.cpp +++ b/tests/auto/qlistview/tst_qlistview.cpp @@ -1617,6 +1617,8 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates() list.setModel(&model); list.setViewMode(QListView::IconMode); list.show(); + QTest::qWaitForWindowShown(&list); + class MyItemDelegate : public QStyledItemDelegate { public: @@ -1631,10 +1633,9 @@ void tst_QListView::task254449_draggingItemToNegativeCoordinates() mutable int numPaints; } delegate; list.setItemDelegate(&delegate); - delegate.numPaints = 0; - QTest::qWaitForWindowShown(&list); //makes sure the layout is done - QTRY_VERIFY(delegate.numPaints > 0); + QApplication::processEvents(); + QTRY_VERIFY(delegate.numPaints > 0); //makes sure the layout is done const QPoint topLeft(-6, 0); list.setPositionForIndex(topLeft, index); |