Class: QgsMapLayerActionContext

Encapsulates the context in which a QgsMapLayerAction action is executed.

Added in version 3.30.

class qgis.gui.QgsMapLayerActionContext[source]

Bases: object

attributeDialog(self) QgsAttributeDialog | None[source]

Returns the attribute dialog associated with the action’s execution.

May be None if the action is not being executed from an attribute dialog.

Return type:

Optional[QgsAttributeDialog]

messageBar(self) QgsMessageBar | None[source]

Returns the message bar associated with the action’s execution.

May be None.

See also

setMessageBar()

Return type:

Optional[QgsMessageBar]

setAttributeDialog(self, dialog: QgsAttributeDialog | None)[source]

Sets the attribute dialog associated with the action’s execution.

Parameters:

dialog (Optional[QgsAttributeDialog])

setMessageBar(self, bar: QgsMessageBar | None)[source]

Sets the message bar associated with the action’s execution.

See also

messageBar()

Parameters:

bar (Optional[QgsMessageBar])