summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreeview/tst_qtreeview.cpp
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-25 07:10:42 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-25 07:10:42 (GMT)
commit34bc83338578491b7728f9b4dce3262cdc1783e6 (patch)
tree050d7c7276a8caa5fe9a7ffb31f95ebbf77fc03e /tests/auto/qtreeview/tst_qtreeview.cpp
parent194013d9db1b3e4ba6f56a864f3b64f523202948 (diff)
parentef08ee8e1d4a4eb26bf2a5fe6c830d4303cb6d3e (diff)
downloadQt-34bc83338578491b7728f9b4dce3262cdc1783e6.zip
Qt-34bc83338578491b7728f9b4dce3262cdc1783e6.tar.gz
Qt-34bc83338578491b7728f9b4dce3262cdc1783e6.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Add QFont::ForceIntegerMetrics style strategy flag Auto test for commit 4a4458d1cf5ec7885c6f63f739b7ee80c70ad211
Diffstat (limited to 'tests/auto/qtreeview/tst_qtreeview.cpp')
-rw-r--r--tests/auto/qtreeview/tst_qtreeview.cpp30
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"