Class: QgsMapLayerActionRegistry¶
A registry which tracks map layer actions.
QgsMapLayerActionRegistry is not usually directly created,
but rather accessed through QgsGui.mapLayerActionRegistry().
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Constructor
Methods
Adds a map layer action to the registry |
|
Returns the default action for a layer |
|
Returns the map layer actions which can run on the specified layer. |
|
Removes a map layer action from the registry |
|
Sets the default action for a layer |
Signals
Triggered when an action is added or removed from the registry |
- class qgis.gui.QgsMapLayerActionRegistry[source]¶
Bases:
QObject- __init__(parent: QObject | None = None)¶
Constructor for QgsMapLayerActionRegistry.
QgsMapLayerActionRegistry is not usually directly created, but rather accessed through
QgsGui.mapLayerActionRegistry().- Parameters:
parent (Optional[QObject] = None)
- addMapLayerAction(self, action: QgsMapLayerAction | None)[source]¶
Adds a map layer action to the registry
- Parameters:
action (Optional[QgsMapLayerAction])
- defaultActionForLayer(self, layer: QgsMapLayer | None) QgsMapLayerAction | None[source]¶
Returns the default action for a layer
- Parameters:
layer (Optional[QgsMapLayer])
- Return type:
- mapLayerActions(self, layer: QgsMapLayer | None, targets: Qgis.MapLayerActionTarget = Qgis.MapLayerActionTarget.AllActions, context: QgsMapLayerActionContext = QgsMapLayerActionContext()) list[QgsMapLayerAction]¶
Returns the map layer actions which can run on the specified layer.
The
contextargument was added in QGIS 3.30.- Parameters:
layer (Optional[QgsMapLayer])
targets (Qgis.MapLayerActionTarget = Qgis.MapLayerActionTarget.AllActions)
context (
QgsMapLayerActionContext= QgsMapLayerActionContext())
- Return type:
list[QgsMapLayerAction]
- removeMapLayerAction(self, action: QgsMapLayerAction | None) bool[source]¶
Removes a map layer action from the registry
- Parameters:
action (Optional[QgsMapLayerAction])
- Return type:
bool
- setDefaultActionForLayer(self, layer: QgsMapLayer | None, action: QgsMapLayerAction | None)[source]¶
Sets the default action for a layer
- Parameters:
layer (Optional[QgsMapLayer])
action (Optional[QgsMapLayerAction])