diff options
author | Robin Burchell <robin.burchell@crimson.no> | 2017-03-30 13:20:02 +0200 |
---|---|---|
committer | Robin Burchell <robin.burchell@crimson.no> | 2017-03-30 14:32:28 +0000 |
commit | 7c3859a49ab5776d6df97858cef5b86688f8e1ce (patch) | |
tree | 4ff2d4b273cc32a7a833b2738305d4b45c599355 /benchmarks | |
parent | 1d9d3df56ee972db58672780071620c7ac48420e (diff) |
Validators: Port to benchmark helpers
Change-Id: I5eae1021f022e6cab6790c29abf80cbeecfdec4a
Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Diffstat (limited to 'benchmarks')
3 files changed, 24 insertions, 61 deletions
diff --git a/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml b/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml index 5e78e59..445c0c9 100644 --- a/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml +++ b/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml @@ -1,28 +1,15 @@ import QtQuick 2.0 +import QmlBench 1.0 -Item { +CreationBenchmark { 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 - - Repeater { - id: repeater - - Item { - property DoubleValidator validator: DoubleValidator { - top: 100 - bottom: 0 - decimals: 2 - } + count: 50; + staticCount: 2500; + delegate: Item { + property DoubleValidator validator: DoubleValidator { + top: 100 + bottom: 0 + decimals: 2 } } } diff --git a/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml b/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml index 5779558..bd5c8d3 100644 --- a/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml +++ b/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml @@ -1,26 +1,14 @@ import QtQuick 2.0 +import QmlBench 1.0 -Item { +CreationBenchmark { 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 - - Repeater { - id: repeater - Item { - property IntValidator validator: IntValidator { - top: 100 - bottom: 0 - } + count: 50; + staticCount: 2500; + delegate: Item { + property IntValidator validator: IntValidator { + top: 100 + bottom: 0 } } } diff --git a/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml b/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml index 38e3379..48ba756 100644 --- a/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml +++ b/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml @@ -1,25 +1,13 @@ import QtQuick 2.0 +import QmlBench 1.0 -Item { +CreationBenchmark { 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 - - Repeater { - id: repeater - Item { - property RegExpValidator validator: RegExpValidator { - regExp: /.*/ - } + count: 50; + staticCount: 2500; + delegate: Item { + property RegExpValidator validator: RegExpValidator { + regExp: /.*/ } } } |