Class: QgsMapLayerActionContext

class qgis.gui.QgsMapLayerActionContext

Bases: sip.wrapper

Encapsulates the context in which a QgsMapLayerAction action is executed.

New in version 3.30:

Methods

attributeDialog

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

messageBar

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

setAttributeDialog

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

setMessageBar

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

attributeDialog(self) QgsAttributeDialog

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:

QgsAttributeDialog

messageBar(self) QgsMessageBar

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

May be None.

See also

setMessageBar()

Return type:

QgsMessageBar

setAttributeDialog(self, dialog: QgsAttributeDialog)

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

Parameters:

dialog (QgsAttributeDialog) –

setMessageBar(self, bar: QgsMessageBar)

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

See also

messageBar()

Parameters:

bar (QgsMessageBar) –