summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtreewidget/tst_qtreewidget.cpp
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-05-12 12:09:25 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-05-12 12:12:45 (GMT)
commitc711885b5694a51f0c22908e57e74c60188bd879 (patch)
treed88edb71d3ff7eb093ba661df74cb4ee82f44260 /tests/auto/qtreewidget/tst_qtreewidget.cpp
parent6319d2d16c0c07f8919a748ed844f3db1e48e827 (diff)
downloadQt-c711885b5694a51f0c22908e57e74c60188bd879.zip
Qt-c711885b5694a51f0c22908e57e74c60188bd879.tar.gz
Qt-c711885b5694a51f0c22908e57e74c60188bd879.tar.bz2
The editor geometry in item views is not correctly updated when 1st
shown The problem is that it gets the previous geometry of the cell whereas its own sizeHint might lead to change the geometry of the cell. Task-number: 253109 Reviewed-by: ogoffart
Diffstat (limited to 'tests/auto/qtreewidget/tst_qtreewidget.cpp')
-rw-r--r--tests/auto/qtreewidget/tst_qtreewidget.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/qtreewidget/tst_qtreewidget.cpp b/tests/auto/qtreewidget/tst_qtreewidget.cpp
index c3595c2..906332c 100644
--- a/tests/auto/qtreewidget/tst_qtreewidget.cpp
+++ b/tests/auto/qtreewidget/tst_qtreewidget.cpp
@@ -136,6 +136,7 @@ private slots:
void rootItemFlags();
void task218661_setHeaderData();
void task245280_sortChildren();
+ void task253109_itemHeight();
// QTreeWidgetItem
void itemOperatorLessThan();
@@ -2879,6 +2880,25 @@ void tst_QTreeWidget::task245280_sortChildren()
QCOMPARE(top.child(i)->text(1), QString::number(i));
}
+void tst_QTreeWidget::task253109_itemHeight()
+{
+ QTreeWidget treeWidget;
+ treeWidget.setColumnCount(1);
+ treeWidget.show();
+ QTest::qWait(200);
+
+ QTreeWidgetItem item(&treeWidget);
+ class MyWidget : public QWidget
+ {
+ virtual QSize sizeHint() const { return QSize(200,100); }
+ } w;
+ treeWidget.setItemWidget(&item, 0, &w);
+
+ QTest::qWait(200);
+ QCOMPARE(w.geometry(), treeWidget.visualItemRect(&item));
+
+}
+
void tst_QTreeWidget::task206367_duplication()
{
QTreeWidget treeWidget;