ModelContextMenu

Search for usage in LXR

ModelContextMenu Class Reference

Properties

alias model
 

Signals

void clicked (var model)
 

Detailed Description

A ModelContextMenu creates a context menu with items populated from a model or a QList<QAction*>.

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:

id: menu
visualParent: someButton
model: myModel
}
id: someButton
onClicked: menu.popup()
}
A ModelContextMenu creates a context menu with items populated from a model or a QList<QAction*>.
alias model
The model containing menu items.

Definition at line 34 of file ModelContextMenu.qml.

Property Documentation

◆ model

alias ModelContextMenu::model
read

The model containing menu items.

Definition at line 39 of file ModelContextMenu.qml.

Member Function Documentation

◆ clicked

void ModelContextMenu::clicked ( var model)
signal

This signal is emitted when a menu item is clicked.

The attached model properties for that menu item are passed as an argument


The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:10:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.