aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/creation/examples/delegates_complex.qml
blob: f78943a9baf13f5e3a933f716353c75040f885f6 (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
34
35
36
37
38
39
40
41
42
43
44
import QtQuick 2.0

Item {
    id: root;
    property int count: 20;
    property int staticCount: 1000;

    property real t;
    NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
    onTChanged: {
        repeater.model = 0;
        repeater.model = root.count
    }

    Component.onCompleted: repeater.model = root.count

    Repeater {
        id: repeater
        Rectangle {
            x: Math.random() * root.width
            y: Math.random() * root.height
            width: 100
            height: 50
            gradient: Gradient {
                GradientStop { position: 0; color: "steelblue" }
                GradientStop { position: 1; color: "black" }
            }
            Repeater {
                model: 10
                Text {
                    id: label
                    x: (index % 2) * 50
                    y: Math.floor(index / 2) * 10;
                    width: 50
                    height: 10
                    horizontalAlignment: Text.AlignHCenter
                    text: "Item #" + index
                    color: "white"
                    font.pixelSize: 10
                }
            }
        }
    }
}