From 114ccb234d875b5680e54fd828195a00267f6ee1 Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Thu, 25 Mar 2010 10:44:39 +0100 Subject: stabilize tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint --- tests/auto/qtreeview/tst_qtreeview.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- cgit v0.12