aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquicklistview/data
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquicklistview/data')
-rw-r--r--tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml b/tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml
new file mode 100644
index 0000000000..12f43b029a
--- /dev/null
+++ b/tests/auto/quick/qquicklistview/data/destroyItemOnCreation.qml
@@ -0,0 +1,37 @@
+import QtQuick 2.0
+
+Rectangle {
+ id: root
+
+ width: 240
+ height: 320
+
+ property int createdIndex: -1
+
+ Component {
+ id: myDelegate
+
+ Rectangle {
+ id: wrapper
+ width: 240; height: 20
+ objectName: "wrapper"
+
+ Text { text: index }
+
+ Component.onCompleted: {
+ root.createdIndex = index
+ ListView.view.model.removeItem(index)
+ }
+ }
+ }
+
+ ListView {
+ id: list
+ objectName: "list"
+ focus: true
+ width: 240
+ height: 320
+ delegate: myDelegate
+ model: testModel
+ }
+}