aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllistmodel/data/protectQObjectFromGC.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmllistmodel/data/protectQObjectFromGC.qml')
-rw-r--r--tests/auto/qml/qqmllistmodel/data/protectQObjectFromGC.qml21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmllistmodel/data/protectQObjectFromGC.qml b/tests/auto/qml/qqmllistmodel/data/protectQObjectFromGC.qml
new file mode 100644
index 0000000000..43b375b681
--- /dev/null
+++ b/tests/auto/qml/qqmllistmodel/data/protectQObjectFromGC.qml
@@ -0,0 +1,21 @@
+import QtQml
+import QtQml.Models
+
+ListModel {
+ id: filesModel
+ property Component testComponent: Component {
+ id: testComponent
+ QtObject {
+ required property string name
+ }
+ }
+ Component.onCompleted: {
+ filesModel.clear()
+ for(let i = 0; i < 10; i++) {
+ filesModel.append({
+ path: testComponent.createObject(null, { name: "" + i })
+ })
+ }
+ gc()
+ }
+}