Class: QgsMapLayerActionRegistry¶
A registry which tracks map layer actions.
QgsMapLayerActionRegistry is not usually directly created,
but rather accessed through QgsGui.mapLayerActionRegistry().
Class Hierarchy¶
Base classes¶
- 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])
- signal changed[source]¶
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.
- defaultActionForLayer(self, layer: QgsMapLayer | None) QgsMapLayerAction | None[source]¶
Returns the default action for a layer
- Parameters:
layer (Optional[QgsMapLayer])
- Return type:
Optional[QgsMapLayerAction]
- mapLayerActions(self, layer: QgsMapLayer | None, 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
contextargument was added in QGIS 3.30.- Parameters:
layer (Optional[QgsMapLayer])
targets (Union[Qgis.MapLayerActionTargets, Qgis.MapLayerActionTarget] = Qgis.MapLayerActionTarget.AllActions)
context (
QgsMapLayerActionContext= QgsMapLayerActionContext())
- Return type:
- 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])