diff options
author | Gunnar Sletta <gunnar@sletta.org> | 2016-05-06 07:28:35 +0100 |
---|---|---|
committer | Gunnar Sletta <gunnar@sletta.org> | 2016-05-06 07:28:35 +0100 |
commit | 93223d3a1f5b88810add43d1b4f5661c8009ea6a (patch) | |
tree | e77673bab489386efd80343eab14631dd4cc7d44 | |
parent | 5dcc804ead9717dedc4a18d82ea4b25dfa557170 (diff) |
Retain the items between iterations in the the empty js creation test
-rw-r--r-- | benchmark/creation/delegates_item_empty_jscreation.qml | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/benchmark/creation/delegates_item_empty_jscreation.qml b/benchmark/creation/delegates_item_empty_jscreation.qml index 6ab784a..36ce3a8 100644 --- a/benchmark/creation/delegates_item_empty_jscreation.qml +++ b/benchmark/creation/delegates_item_empty_jscreation.qml @@ -3,6 +3,7 @@ import QtQuick 2.0 Item { id: root; property int count: 50; + property var items; property real t; NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite } @@ -17,9 +18,16 @@ Item { } function allocate() { + + if (items && items.length) { + for (var i=0; i<items.length; ++i) + items[i].destroy(); + } + items = []; + for (var i=0; i<root.count; ++i) { - var object = component.createObject(); - object.destroy(); + var object = component.createObject(root); + items.push(object); } } } |