Provides a menu component for use as a context menu, popup menu, or as part of a menu bar. More...
| Import Statement: | import QtQuick.Controls . |
| Since: | Qt 5.1 |
[Missing image menu.png]
Menu {
title: "Edit"
MenuItem {
text: "Cut"
shortcut: "Ctrl+X"
onTriggered: ...
}
MenuItem {
text: "Copy"
shortcut: "Ctrl+C"
onTriggered: ...
}
MenuItem {
text: "Paste"
shortcut: "Ctrl+V"
onTriggered: ...
}
MenuSeparator { }
Menu {
title: "More Stuff"
MenuItem {
text: "Do Nothing"
}
}
}
The main uses for menus:
Note that some properties, such as enabled, text, or iconSource, only make sense in a particular use case of the menu.
See also MenuBar, MenuItem, and MenuSeparator.
The style Component for this control.
This QML property was introduced in QtQuick.Controls.Styles 1.2.
See also MenuStyle.