Class: QgsProcessingAlgorithmConfigurationWidget

A configuration widget for processing algorithms allows providing additional configuration options directly on algorithm level, in addition to parameters.

Added in version 3.2.

Note

This is an abstract class, with methods which must be implemented by a subclass.

The following methods must be implemented: configuration(), setConfiguration()

Class Hierarchy

Inheritance diagram of qgis.gui.QgsProcessingAlgorithmConfigurationWidget

Base classes

QWidget

QObject

QPaintDevice

QgsExpressionContextGenerator

Abstract interface for generating an expression context.

Abstract Methods

configuration

Read the current configuration from this widget.

setConfiguration

Set the configuration which this widget should represent.

Methods

algorithm

Returns the algorithm instance associated with this widget.

registerProcessingContextGenerator

Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required.

setAlgorithm

Sets the algorithm instance associated with the widget.

widgetContext

Returns the context in which the Processing algorithm widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

Virtual Methods

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

setWidgetContext

Sets the context in which the Processing algorithm widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

class qgis.gui.QgsProcessingAlgorithmConfigurationWidget[source]

Bases: QWidget, QgsExpressionContextGenerator

__init__(parent: QWidget | None = None)

Creates a new QgsProcessingAlgorithmConfigurationWidget

Parameters:

parent (Optional[QWidget] = None)

algorithm(self) QgsProcessingAlgorithm | None[source]

Returns the algorithm instance associated with this widget.

See also

setAlgorithm()

Added in version 3.6.

Return type:

Optional[QgsProcessingAlgorithm]

abstract configuration(self) Dict[str, Any][source]

Read the current configuration from this widget.

Return type:

Dict[str, Any]

registerProcessingContextGenerator(self, generator: QgsProcessingContextGenerator | None)[source]

Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required.

Added in version 3.6.

Parameters:

generator (Optional[QgsProcessingContextGenerator])

setAlgorithm(self, algorithm: QgsProcessingAlgorithm | None)[source]

Sets the algorithm instance associated with the widget.

See also

algorithm()

Added in version 3.6.

Parameters:

algorithm (Optional[QgsProcessingAlgorithm])

abstract setConfiguration(self, configuration: Dict[str, Any])[source]

Set the configuration which this widget should represent.

Parameters:

configuration (Dict[str, Any])

virtual setWidgetContext(self, context: QgsProcessingParameterWidgetContext)[source]

Sets the context in which the Processing algorithm widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

Subclasses should take care to call the base class method when reimplementing this method.

See also

widgetContext()

Added in version 3.6.

Parameters:

context (QgsProcessingParameterWidgetContext)

widgetContext(self) QgsProcessingParameterWidgetContext

Returns the context in which the Processing algorithm widget is shown, e.g., the parent model algorithm, a linked map canvas, and other relevant information which allows the widget to fine-tune its behavior.

Added in version 3.6.

Return type:

QgsProcessingParameterWidgetContext