aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickrepeater/data/innerRequired.qml
blob: 5498232fc1d5396dbfe2998f582562d0e6e30274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import QtQuick

Item {
    ListModel {
        id: myModel
        ListElement { type: "Dog"; age: 8; noise: "meow" }
        ListElement { type: "Cat"; age: 5; noise: "woof" }
    }

    component SomeDelegate: Item {
        required property int age
        property string text
    }

    component AnotherDelegate: Item {
        property int age
        property string text

        SomeDelegate {
            age: 0
            text: ""
        }
    }

    Repeater {
        id: repeater
        model: myModel
        delegate: AnotherDelegate {
            age: model.age
            text: model.noise
        }
    }
}