MenuItem QML Type
A menu item within a Menu. More...
| Import Statement: | import QtQuick.Controls 2.0 |
| Since: | Qt 5.7 |
| Inherits: |
Properties
- checkable : bool
- highlighted : bool
Signals
- void triggered()
Detailed Description
MenuItem is a convenience type that implements the AbstractButton API, providing an easy way to respond to menu items being clicked, for example.
Button {
id: fileButton
text: "File"
onClicked: menu.open()
}
Menu {
id: menu
anchor.target: fileButton
MenuItem {
text: "New..."
}
MenuItem {
text: "Open..."
}
MenuItem {
text: "Save"
}
}
See also Customizing MenuItem and Menu Controls.
Property Documentation
This property holds whether the menu item is highlighted.
A menu item can be highlighted in order to draw the user's attention towards it. It has no effect on keyboard interaction.
The default value is false.