Class: QgsProcessingToolboxContextAction

A custom action to show in the context menu for the Processing toolbox.

Added in version 4.4.

List of all members, including inherited members

Constructor

__init__

Methods

actionName

Returns the action's (translated, user visible) name.

getItemData

Returns the associated algorithm the action will be shown for.

getToolbox

Returns the parent toolbox the action will be shown in.

isSeparator

Returns True if the action is a separator action.

setActionName

Sets the action's (translated, user visible) name.

setData

Sets the associated algorithm and toolbox the action will be shown for.

setIsSeparator

Sets whether the action is a separator action.

setItemData

Sets the associated algorithm the action will be shown for.

setToolbox

Sets the parent toolbox the action will be shown in.

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsProcessingToolboxContextAction. See the FAQ for more details.

execute

Executes the action.

icon

Returns the icon to use for the action.

isCompatibleWithAlgorithm

Returns True if the action is compatible with the specified provider and algorithm.

isEnabled

Returns True if the action is enabled.

trigger

Triggers the action.

class qgis.gui.QgsProcessingToolboxContextAction[source]

Bases: object

__init__(name: str | None = '')

Constructor for QgsProcessingToolboxContextAction.

Parameters:

name (str|None = '')

__init__(a0: QgsProcessingToolboxContextAction)
Parameters:

a0 (QgsProcessingToolboxContextAction)

actionName(self) → str[source]

Returns the action’s (translated, user visible) name.

Return type:

str

virtual execute(self)[source]

Executes the action.

Deprecated since version 4.4: Use trigger() instead.

getItemData(self) → QgsProcessingAlgorithm | None[source]

Returns the associated algorithm the action will be shown for.

Deprecated since version 4.4.

Return type:

QgsProcessingAlgorithm|None

getToolbox(self) → QgsDockWidget | None[source]

Returns the parent toolbox the action will be shown in.

Deprecated since version 4.4.

Return type:

QgsDockWidget|None

virtual icon(self) → QIcon[source]

Returns the icon to use for the action.

Return type:

QIcon

virtual isCompatibleWithAlgorithm(self, providerId: str | None, algorithmName: str | None) → bool[source]

Returns True if the action is compatible with the specified provider and algorithm.

Parameters:
  • providerId (str|None)

  • algorithmName (str|None)

Return type:

bool

virtual isEnabled(self) → bool[source]

Returns True if the action is enabled.

Deprecated since version 4.4.

Return type:

bool

isSeparator(self) → bool[source]

Returns True if the action is a separator action.

See also

setIsSeparator()

Return type:

bool

property is_separator

Returns True if the action is a separator action.

See also

setIsSeparator()

Return type:

bool

property itemData

Returns the associated algorithm the action will be shown for.

Deprecated since version 4.4.

Return type:

QgsProcessingAlgorithm|None

setActionName(self, name: str | None)[source]

Sets the action’s (translated, user visible) name.

Deprecated since version 4.4: Use the constructor setter instead.

Parameters:

name (str|None)

setData(self, data: QgsProcessingAlgorithm | None, toolbox: QgsDockWidget | None)[source]

Sets the associated algorithm and toolbox the action will be shown for.

Deprecated since version 4.4.

Parameters:
setIsSeparator(self, isSeparator: bool)[source]

Sets whether the action is a separator action.

See also

isSeparator()

Parameters:

isSeparator (bool)

setItemData(self, data: QgsProcessingAlgorithm | None)[source]

Sets the associated algorithm the action will be shown for.

Deprecated since version 4.4.

Parameters:

data (QgsProcessingAlgorithm|None)

setToolbox(self, toolbox: QgsDockWidget | None)[source]

Sets the parent toolbox the action will be shown in.

Deprecated since version 4.4.

Parameters:

toolbox (QgsDockWidget|None)

property toolbox

Returns the parent toolbox the action will be shown in.

Deprecated since version 4.4.

Return type:

QgsDockWidget|None

virtual trigger(self, context: QgsProcessingActionContext)[source]

Triggers the action.

Parameters:

context (QgsProcessingActionContext)