diff options
author | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2010-03-26 09:54:34 (GMT) |
---|---|---|
committer | Gabriel de Dietrich <gabriel.dietrich-de@nokia.com> | 2010-03-26 11:45:00 (GMT) |
commit | fa40e6fd8b719e2edfdbde94ac70431c68e92449 (patch) | |
tree | 674345168ee80748cd98f9ae8a287563d12a129e /tests/auto/qtreeview | |
parent | ff870dbf9106f2bbb2cf64f5aa35fc5917e5f4f2 (diff) | |
download | Qt-fa40e6fd8b719e2edfdbde94ac70431c68e92449.zip Qt-fa40e6fd8b719e2edfdbde94ac70431c68e92449.tar.gz Qt-fa40e6fd8b719e2edfdbde94ac70431c68e92449.tar.bz2 |
Stabilize tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint
Non expected paint events and screen size on pulse_qws/linux-x86-g++
seem to be the reason the auto-test fails.
Reviewed-by: jeremy
Diffstat (limited to 'tests/auto/qtreeview')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index 6871982..2de189d 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -3721,11 +3721,13 @@ class TreeViewQTBUG_9216 : public QTreeView public: void paintEvent(QPaintEvent *event) { - QCOMPARE(event->rect(), viewport()->rect()); + if (doCompare) + QCOMPARE(event->rect(), viewport()->rect()); QTreeView::paintEvent(event); painted++; } int painted; + bool doCompare; }; void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint() @@ -3737,15 +3739,16 @@ void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint() TreeViewQTBUG_9216 view; view.setUniformRowHeights(true); view.setModel(&model); - view.resize(800, 800); view.painted = 0; + view.doCompare = false; 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); + view.doCompare = true; + model.setData(model.index(0, 0), QVariant(QSize(50, 50)), Qt::SizeHintRole); QTest::qWait(100); QTRY_VERIFY(view.painted > 0); } |