aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/creation/quick.image/delegates_image.qml
blob: d01ffe2d2c20db70d04d61ef53e838d8fbe1d913 (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
import QtQuick 2.0

Item {
    id: root;
    property int count: 50;
    property int staticCount: 2500;

    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

    property var names: [
        "butterfly-wide.png",
        "butterfly-half.png",
        "butterfly-collapsed.png"
    ];

    Repeater {
        id: repeater
        Image {
            x: Math.random() * (root.width - width)
            y: Math.random() * (root.height - height)
            source: "../../../../shared/" + root.names[index % 3];
            width: 20
            height: 20

        }
    }
}