Class: QgsAttributeEditorAction

class qgis.core.QgsAttributeEditorAction

Bases: QgsAttributeEditorElement

This element will load a layer action onto the form.

Added in version 3.22.

QgsAttributeEditorAction(action: QgsAction, parent: Optional[QgsAttributeEditorElement]) Creates a new element which can display a layer action.

Parameters:
  • action – The action

  • parent – The parent (used as container)

QgsAttributeEditorAction(uuid: QUuid, parent: Optional[QgsAttributeEditorElement]) Creates a new element which can display a layer action, this constructor allows to create a QgsAttributeEditorAction when actions are not yet loaded.

Parameters:
  • uuid – The action unique identifier (UUID).

  • parent – The parent (used as container).

QgsAttributeEditorAction(a0: QgsAttributeEditorAction)

Methods

action

Returns the (possibly lazy loaded) action for the given layer.

clone

param parent:

setAction

Set the action to newAction.

action(self, layer: QgsVectorLayer | None) QgsAction

Returns the (possibly lazy loaded) action for the given layer.

Parameters:

layer (Optional[QgsVectorLayer])

Return type:

QgsAction

clone(self, parent: QgsAttributeEditorElement | None) QgsAttributeEditorElement | None
Parameters:

parent (Optional[QgsAttributeEditorElement])

Return type:

Optional[QgsAttributeEditorElement]

setAction(self, newAction: QgsAction)

Set the action to newAction.

Parameters:

newAction (QgsAction)