Class: QgsLayerTreeViewMenuProvider

class qgis.gui.QgsLayerTreeViewMenuProvider

Bases: sip.wrapper

Implementation of this interface can be implemented to allow QgsLayerTreeView instance to provide custom context menus (opened upon right-click).

See also

QgsLayerTreeView

Added in version 2.4:

Methods

createContextMenu

Returns a newly created menu instance (or None on error)

createContextMenu(self) QMenu | None

Returns a newly created menu instance (or None on error)

Return type:

Optional[QMenu]