diff options
Diffstat (limited to 'src/benchmarks/auto/creation/quick.controls2')
20 files changed, 364 insertions, 0 deletions
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml new file mode 100644 index 0000000..6706d51 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's BusyIndicator type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: BusyIndicator { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + running: index % 2 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_button.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_button.qml new file mode 100644 index 0000000..ab9b939 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_button.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's Button type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: Button { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "Button" + down: index % 2 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml new file mode 100644 index 0000000..4603acb --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's CheckBox type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: CheckBox { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "CheckBox" + checked: index % 2 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml new file mode 100644 index 0000000..7eef93a --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's ComboBox type. +CreationBenchmark { + id: root + count: 20 + staticCount: 250 + delegate: ComboBox { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + model: 5 + currentIndex: index % count + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_dial.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_dial.qml new file mode 100644 index 0000000..a245f2c --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_dial.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's Dial type. +CreationBenchmark { + id: root + count: 20 + staticCount: 500 + delegate: Dial { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + value: index / root.staticCount + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml new file mode 100644 index 0000000..61f7c64 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's ItemDelegate type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: ItemDelegate { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "ItemDelegate" + down: index % 2 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_label.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_label.qml new file mode 100644 index 0000000..7624e90 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_label.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's Label type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: Label { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "Qt Quick!" + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml new file mode 100644 index 0000000..71a5b98 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml @@ -0,0 +1,47 @@ +import QmlBench 1.0 +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +CreationBenchmark { + id: root + count: 2 + staticCount: 25 + + Component { + id: menuItemComponent + + MenuItem { + contentItem: Text { + text: parent.text + color: "navajowhite" + } + background: Rectangle { + color: "steelblue" + } + } + } + + delegate: Item { + Menu { + id: menu + title: "Root Menu" + delegate: menuItemComponent + visible: true + + Menu { + title: "Sub-menu 1" + delegate: menuItemComponent + + Menu { + title: "Sub-sub-menu" + delegate: menuItemComponent + } + } + + Menu { title: "Sub-menu 2" } + Action { text: "Action 3" } + Action { text: "Action 4" } + Action { text: "Action 5" } + } + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml new file mode 100644 index 0000000..adefbc7 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's MenuItem type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: MenuItem { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "MenuItem" + checkable: index % 2 + checked: index % 2 + down: index % 3 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml new file mode 100644 index 0000000..6c2475d --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's ProgressBar type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: ProgressBar { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + value: index / root.staticCount + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml new file mode 100644 index 0000000..86847cf --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml @@ -0,0 +1,17 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's RadioButton type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: RadioButton { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "CheckBox" + autoExclusive: false + checked: index % 2 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml new file mode 100644 index 0000000..8e73e9d --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's ScrollBar type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: ScrollBar { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + height: 100 + size: index / root.staticCount + pressed: index % 2 + active: true + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml new file mode 100644 index 0000000..eea7e34 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.2 + +// Tests the creation of QQC2's ScrollView type. +CreationBenchmark { + id: root + count: 20 + staticCount: 250 + delegate: ScrollView { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + width: 100 + height: 100 + Item { + implicitWidth: 200 + implicitHeight: 200 + } + ScrollBar.vertical.active: true + ScrollBar.vertical.pressed: index % 3 === 1 + ScrollBar.horizontal.active: true + ScrollBar.horizontal.pressed: index % 3 === 2 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_slider.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_slider.qml new file mode 100644 index 0000000..bf6df75 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_slider.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's Slider type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: Slider { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + value: index / root.staticCount + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml new file mode 100644 index 0000000..4ac4a95 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's SpinBox type. +CreationBenchmark { + id: root + count: 20 + staticCount: 250 + delegate: SpinBox { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + value: index / root.staticCount * to + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_switch.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_switch.qml new file mode 100644 index 0000000..d780bd1 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_switch.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's Switch type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: Switch { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "Switch" + checked: index % 2 + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml new file mode 100644 index 0000000..418deb5 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's TabBar type. +CreationBenchmark { + id: root + count: 20 + staticCount: 250 + delegate: TabBar { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + currentIndex: index / root.staticCount * count + TabButton { + text: "Tab1" + } + TabButton { + text: "Tab2" + } + TabButton { + text: "Tab3" + } + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml new file mode 100644 index 0000000..28d1fb0 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's TextArea type. +CreationBenchmark { + id: root + count: 20 + staticCount: 500 + delegate: TextArea { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "Text\nArea" + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml new file mode 100644 index 0000000..6f03459 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's TextField type. +CreationBenchmark { + id: root + count: 20 + staticCount: 1000 + delegate: TextField { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + text: "TextField" + } +} diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml new file mode 100644 index 0000000..9d80215 --- /dev/null +++ b/src/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml @@ -0,0 +1,16 @@ +import QtQuick 2.0 +import QmlBench 1.0 +import QtQuick.Controls 2.0 + +// Tests the creation of QQC2's Tumbler type. +CreationBenchmark { + id: root + count: 20 + staticCount: 250 + delegate: Tumbler { + x: QmlBench.getRandom() * root.width - width + y: QmlBench.getRandom() * root.height - height + model: 5 + currentIndex: index % count + } +} |