aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml
blob: 71a5b98ab7a50ad8b55e828b7fb33ff535194b39 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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" }
        }
    }
}