aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/animations/comparison/moving-images-animations.qml
blob: 88e19019f27935ce0928c9c5b9c8f107c10374ee (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
import QtQuick 2.2

Item {
    id: root;

    property int size: Math.sqrt(width * height / count);
    property int count: 500
    property int staticCount: 20000

    Grid {
        width: root.width
        height: root.height
        columns: Math.ceil(root.width / root.size);
        rows: Math.ceil(root.height / root.size);
        Repeater {
            model: root.count
            Image {
                source: "../../../../shared/butterfly-wide.png"
                sourceSize: Qt.size(root.size, root.size);
                SequentialAnimation on rotation {
                    PauseAnimation { duration: 200 + Math.random() * 200 }
                    NumberAnimation { from: -10; to: 10; duration: 500; easing.type: Easing.InOutCubic }
                    NumberAnimation { from: 10; to: -10; duration: 500; easing.type: Easing.InOutCubic }
                    loops: Animation.Infinite
                }
            }
        }
    }
}