diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-24 14:28:46 (GMT) |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> | 2010-03-24 14:28:46 (GMT) |
commit | bbf096c7ba589d05df8b8bce724e9393deb8f3b4 (patch) | |
tree | 0689bfba547d519486eec6529fb3e88202615519 /tests/auto | |
parent | 6d0002fe9bc91b9901e56050d247fbded09c9c76 (diff) | |
parent | 8c10e0b73c312a6c1aacce11cc8d6f57dc94a09d (diff) | |
download | Qt-bbf096c7ba589d05df8b8bce724e9393deb8f3b4.zip Qt-bbf096c7ba589d05df8b8bce724e9393deb8f3b4.tar.gz Qt-bbf096c7ba589d05df8b8bce724e9393deb8f3b4.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qtreeview/tst_qtreeview.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/qtreeview/tst_qtreeview.cpp b/tests/auto/qtreeview/tst_qtreeview.cpp index bdc0a0c..da99368 100644 --- a/tests/auto/qtreeview/tst_qtreeview.cpp +++ b/tests/auto/qtreeview/tst_qtreeview.cpp @@ -237,6 +237,7 @@ private slots: void task245654_changeModelAndExpandAll(); void doubleClickedWithSpans(); void taskQTBUG_6450_selectAllWith1stColumnHidden(); + void taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint(); }; class QtTestModel: public QAbstractItemModel @@ -3714,5 +3715,34 @@ void tst_QTreeView::taskQTBUG_6450_selectAllWith1stColumnHidden() QVERIFY(tree.selectionModel()->isRowSelected(i, QModelIndex())); } +class TreeViewQTBUG_9216 : public QTreeView +{ + Q_OBJECT +public: + void paintEvent(QPaintEvent *event) + { + QCOMPARE(event->rect(), viewport()->rect()); + QTreeView::paintEvent(event); + } +}; + +void tst_QTreeView::taskQTBUG_9216_setSizeAndUniformRowHeightsWrongRepaint() +{ + QStandardItemModel model(10, 10, this); + for (int row = 0; row < 10; row++) + for (int col = 0; col < 10; col++) + model.setItem(row, col, new QStandardItem(QString("row %0, col %1").arg(row).arg(col))); + TreeViewQTBUG_9216 view; + view.setUniformRowHeights(true); + view.setModel(&model); + view.resize(800, 800); + view.show(); + QTest::qWaitForWindowShown(&view); + + QTest::qWait(100); // This one is needed to make the test fail before the patch. + model.setData(model.index(0, 5), QVariant(QSize(100,100)), Qt::SizeHintRole); + QTest::qWait(100); +} + QTEST_MAIN(tst_QTreeView) #include "tst_qtreeview.moc" |