Class: QgsLayoutViewMenuProvider

Interface for a QgsLayoutView context menu.

Implementations of this interface can be made to allow QgsLayoutView instances to provide custom context menus (opened upon right-click).

See also

QgsLayoutView

Methods

createContextMenu

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

class qgis.gui.QgsLayoutViewMenuProvider[source]

Bases: object

createContextMenu(self, parent: QWidget | None, layout: QgsLayout | None, layoutPoint: QPointF | QPoint) QMenu | None[source]

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

Parameters:
  • parent (Optional[QWidget])

  • layout (Optional[QgsLayout])

  • layoutPoint (Union[QPointF, QPoint])

Return type:

Optional[QMenu]