Class: QgsLayerTreeViewMenuProvider

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

See also

QgsLayerTreeView

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: createContextMenu()

Abstract Methods

createContextMenu

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

class qgis.gui.QgsLayerTreeViewMenuProvider[source]

Bases: object

abstract createContextMenu(self) QMenu | None[source]

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

Return type:

Optional[QMenu]