aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qmlcppcodegen/data/readonlyListProperty.qml
blob: 149638283b1591da33e15ad19467986e65222f23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import QtQml

QtObject {
    id: testObj

    // "readonly" means the identity of the list cannot be changed.
    // Its contents can be changed.
    readonly default property list<QtObject> theList

    Component.onCompleted: {
        for (var i = 0; i < 4; i++)
            testObj.theList.push(testObj)
    }

    property int l: theList.length
}