Class: QgsProcessingParameterDefinitionWidget

A widget which allows users to specify the properties of a Processing parameter.

Added in version 3.10.

Class Hierarchy

Inheritance diagram of qgis.gui.QgsProcessingParameterDefinitionWidget

Base classes

QWidget

QObject

QPaintDevice

Methods

createParameter

Returns a new instance of a parameter definition, using the current settings defined in the dialog.

registerProcessingContextGenerator

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

class qgis.gui.QgsProcessingParameterDefinitionWidget[source]

Bases: QWidget

__init__(type: str | None, context: QgsProcessingContext, widgetContext: QgsProcessingParameterWidgetContext, definition: QgsProcessingParameterDefinition | None = None, algorithm: QgsProcessingAlgorithm | None = None, parent: QWidget | None = None)

Constructor for QgsProcessingParameterDefinitionWidget, for a parameter of the specified type.

The context argument must specify a Processing context, which will be used by the widget to evaluate existing definition properties such as default values. Similarly, the widgetContext argument specifies the wider GUI context in which the widget will be used.

The optional definition argument may be used to provide a parameter definition to use to initially populate the widget’s state.

Additionally, the optional algorithm parameter may be used to specify the algorithm or model associated with the parameter.

Parameters:
createParameter(self, name: str | None = '') QgsProcessingParameterDefinition | None[source]

Returns a new instance of a parameter definition, using the current settings defined in the dialog.

The name parameter specifies the name for the newly created parameter.

Parameters:

name (Optional[str] = '')

Return type:

Optional[QgsProcessingParameterDefinition]

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.18.

Parameters:

generator (Optional[QgsProcessingContextGenerator])