aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qmltest/listview/tst_listview.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qmltest/listview/tst_listview.qml')
-rw-r--r--tests/auto/qmltest/listview/tst_listview.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qmltest/listview/tst_listview.qml b/tests/auto/qmltest/listview/tst_listview.qml
index ef9f73e005..65f736f305 100644
--- a/tests/auto/qmltest/listview/tst_listview.qml
+++ b/tests/auto/qmltest/listview/tst_listview.qml
@@ -51,6 +51,22 @@ Item {
}
ListView {
+ id: singleElementList
+ height: 20
+ width: 50
+ model: 1
+ property real heightForDelegate: 100
+ property real contentHeightOnDelegateResize
+ delegate: Rectangle {
+ height: singleElementList.heightForDelegate
+ onHeightChanged: {
+ singleElementList.forceLayout();
+ singleElementList.contentHeightOnDelegateResize = singleElementList.contentHeight;
+ }
+ }
+ }
+
+ ListView {
id: viewmanyitems
model: manyitems
delegate: Text { text: model.name }
@@ -319,5 +335,10 @@ Item {
compare(listInteractiveCurrentIndexEnforce.currentIndex, 1);
tryCompare(listInteractiveCurrentIndexEnforce, "contentX", listInteractiveCurrentIndexEnforce.width);
}
+
+ function test_forceLayoutForContentHeight() {
+ singleElementList.heightForDelegate = 200;
+ compare(singleElementList.contentHeightOnDelegateResize, 200);
+ }
}
}