Class: QgsProcessingParameterWidgetContext

class qgis.gui.QgsProcessingParameterWidgetContext

Bases: sip.wrapper

Constructor for QgsProcessingParameterWidgetContext.

QgsProcessingParameterWidgetContext(QgsProcessingParameterWidgetContext)

Contains settings which reflect the context in which a Processing parameter 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.

Methods

mapCanvas

Returns the map canvas associated with the widget.

model

Returns the model which the parameter widget is associated with.

modelChildAlgorithmId

Returns the child algorithm ID within the model which the parameter widget is associated with.

project

Returns the project associated with the widget.

setMapCanvas

Sets the map canvas associated with the widget.

setModel

Sets the model which the parameter widget is associated with.

setModelChildAlgorithmId

Sets the child algorithm id within the model which the parameter widget is associated with.

setProject

Sets the project associated with the widget.

mapCanvas(self)QgsMapCanvas

Returns the map canvas associated with the widget.

See also

setMapCanvas()

Return type

QgsMapCanvas

model(self)QgsProcessingModelAlgorithm

Returns the model which the parameter widget is associated with.

See also

setModel()

Return type

QgsProcessingModelAlgorithm

modelChildAlgorithmId(self) → str

Returns the child algorithm ID within the model which the parameter widget is associated with.

See also

model()

Return type

str

project(self)QgsProject

Returns the project associated with the widget.

See also

setProject()

Return type

QgsProject

setMapCanvas(self, canvas: QgsMapCanvas)

Sets the map canvas associated with the widget. This allows the widget to retrieve the current map scale and other properties from the canvas.

See also

mapCanvas()

Parameters

canvas (QgsMapCanvas) –

setModel(self, model: QgsProcessingModelAlgorithm)

Sets the model which the parameter widget is associated with.

See also

model()

Parameters

model (QgsProcessingModelAlgorithm) –

setModelChildAlgorithmId(self, id: str)

Sets the child algorithm id within the model which the parameter widget is associated with.

See also

setModel()

Parameters

id (str) –

setProject(self, project: QgsProject)

Sets the project associated with the widget. This allows the widget to retrieve the map layers and other properties from the correct project.

See also

project()

New in version 3.8.

Parameters

project (QgsProject) –