aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/layouts/gridlayout_large.qml
blob: 340a468fb1536d247819ec581c569112599889be (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
import QtQuick 2.2
import QmlBench 1.0
import QtQuick.Layouts 1.3

Benchmark {
    id: root;
    count: 50;
    staticCount: 1000;

    // For each frame, change each child item of the layout:
    //      * Layout.rowSpan
    //      * Layout.columnSpan

    property int frameCounter : 0
    onTChanged: {
        frameCounter++
    }
    GridLayout {
        columns: 100
        Repeater {
            id: repeater
            model: root.count
            Rectangle {
                color: Qt.hsla((index / 50) % 1, 1.0, 0.8)
                Layout.columnSpan: (index * 3) % 17 + 1 + frameCounter % 10
                Layout.rowSpan: (index * 5) % 17 + 1 + frameCounter % 10
                implicitWidth: 0
                implicitHeight: 0
                Layout.fillWidth: true
                Layout.fillHeight: true
            }
        }
    }
}