diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-25 09:44:39 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2010-03-25 09:44:39 (GMT) |
commit | 114ccb234d875b5680e54fd828195a00267f6ee1 (patch) | |
tree | 59bf1862782656c96ff56954d9aafb3288de1dea /tests/auto | |
parent | 34bc83338578491b7728f9b4dce3262cdc1783e6 (diff) | |
download | Qt-114ccb234d875b5680e54fd828195a00267f6ee1.zip Qt-114ccb234d875b5680e54fd828195a00267f6ee1.tar.gz Qt-114ccb234d875b5680e54fd828195a00267f6ee1.tar.bz2 |
stabilize tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index da99368..6871982 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -3723,7 +3723,9 @@ public: { QCOMPARE(event->rect(), viewport()->rect()); QTreeView::paintEvent(event); + painted++; } + int painted; }; void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint() @@ -3736,12 +3738,16 @@ void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint() view.setUniformRowHeights(true); view.setModel(&model); view.resize(800, 800); + view.painted = 0; view.show(); QTest::qWaitForWindowShown(&view); + QTRY_VERIFY(view.painted > 0); QTest::qWait(100); // This one is needed to make the test fail before the patch. + view.painted = 0; model.setData(model.index(0, 5), QVariant(QSize(100,100)), Qt::SizeHintRole); QTest::qWait(100); + QTRY_VERIFY(view.painted > 0); } QTEST_MAIN(tst_QTreeView) |