ModelContextMenu QML Type
A ModelContextMenu creates a context menu with items populated from a model or a QList<QAction*>. More...
- Import Statement: import org.kde.plasma.extras
Detailed Description
For standard item models, actions are created using the following model role names or properties:
- display - a string contains the action name
- decoration - an icon to display
- separator - boolean that will add a separator in the list
Example code:
ModelContextMenu {
id: menu
visualParent: someButton
model: myModel
}
Button {
id: someButton
onClicked: menu.popup()
}
Property Documentation
model : model
The model containing menu items
Signal Documentation
clicked(var model)
This signal is emitted when a menu item is clicked. The attached model properties for that menu item are passed as an argument
Note: The corresponding handler is
onClicked.