aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmllistmodel/data/protectQObjectFromGC.qml
blob: 43b375b68140805a6c389f856aba642e9c53d4c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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()
    }
}