Class: QgsMapLayerActionRegistry

class qgis.gui.QgsMapLayerActionRegistry

Bases: PyQt5.QtCore.QObject

This class tracks map layer actions.

QgsMapLayerActionRegistry is not usually directly created, but rather accessed through QgsGui.mapLayerActionRegistry().

QgsMapLayerActionRegistry(parent: QObject = None) Constructor for QgsMapLayerActionRegistry.

QgsMapLayerActionRegistry is not usually directly created, but rather accessed through QgsGui.mapLayerActionRegistry().

Methods

addMapLayerAction

Adds a map layer action to the registry

childEvent

connectNotify

customEvent

defaultActionForLayer

Returns the default action for a layer

disconnectNotify

isSignalConnected

mapLayerActions

Returns the map layer actions which can run on the specified layer.

receivers

removeMapLayerAction

Removes a map layer action from the registry

sender

senderSignalIndex

setDefaultActionForLayer

Sets the default action for a layer

timerEvent

Signals

changed

pyqtSignal(*types, name: str = ..., revision: int = ..., arguments: Sequence = ...) -> PYQT_SIGNAL

addMapLayerAction(self, action: QgsMapLayerAction)

Adds a map layer action to the registry

Parameters:

action (QgsMapLayerAction) –

changed

pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL

types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.

Parameters:
  • name (str = ...) –

  • revision (int = ...) –

  • arguments (Sequence = ...) –

Return type:

PYQT_SIGNAL

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
defaultActionForLayer(self, layer: QgsMapLayer) QgsMapLayerAction

Returns the default action for a layer

Parameters:

layer (QgsMapLayer) –

Return type:

QgsMapLayerAction

disconnectNotify(self, QMetaMethod)
isSignalConnected(self, QMetaMethod) bool
mapLayerActions(self, layer: QgsMapLayer, targets: Qgis.MapLayerActionTargets | Qgis.MapLayerActionTarget = Qgis.MapLayerActionTarget.AllActions, context: QgsMapLayerActionContext = QgsMapLayerActionContext()) List[QgsMapLayerAction]

Returns the map layer actions which can run on the specified layer.

The context argument was added in QGIS 3.30.

Parameters:
Return type:

List[QgsMapLayerAction]

receivers(self, PYQT_SIGNAL) int
removeMapLayerAction(self, action: QgsMapLayerAction) bool

Removes a map layer action from the registry

Parameters:

action (QgsMapLayerAction) –

Return type:

bool

sender(self) QObject
senderSignalIndex(self) int
setDefaultActionForLayer(self, layer: QgsMapLayer, action: QgsMapLayerAction)

Sets the default action for a layer

Parameters:
timerEvent(self, QTimerEvent)