diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2018-09-27 14:51:35 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2018-10-12 08:04:41 +0000 |
commit | abf1200b8fd75bdef9ada84fc2c6d4b475e328b1 (patch) | |
tree | 3d162c899ebfc64369a6854cf9039a44d2b19a46 /benchmarks | |
parent | b7d11c911e3390d3b5e84d30531e23d06cb18204 (diff) |
Add a creation benchmark for Menus with custom delegates
Change-Id: I1f984d2290aa78904b5a61e18e6439438291fb99
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'benchmarks')
-rw-r--r-- | benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml b/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml new file mode 100644 index 0000000..71a5b98 --- /dev/null +++ b/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" } + } + } +} |