aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/creation/quick/delegates_qobject.qml
blob: 130d722be5f01a57e48a0db847cf7e9e1974c25e (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
import QtQuick 2.0
import QmlBench 1.0

// Test allocation of QObject, with no Repeater or anything.
// Compare with delegates_qobject & delegates_item_empty.
Benchmark {
    id: root;
    count: 50;
    staticCount: 10000;

    onTChanged: {
        allocate();
    }

    Component {
        id: component;
        QtObject {
        }
    }

    function allocate() {
        for (var i=0; i<root.count; ++i) {
            var object = component.createObject();
            object.destroy();
        }
    }
}