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.
New in version 3.4:
Methods
Returns the current active layer.
Returns the browser model associated with the widget.
Returns the map canvas associated with the widget.
Returns the message bar associated with the widget.
Returns the model which the parameter widget is associated with.
Returns the child algorithm ID within the model which the parameter widget is associated with.
Returns the project associated with the widget.
Sets the current active
layer
.Sets the browser
model
associated with the widget.Sets the map
canvas
associated with the widget.Sets the message
bar
associated with the widget.Sets the
model
which the parameter widget is associated with.Sets the child algorithm
id
within the model which the parameter widget is associated with.Sets the
project
associated with the widget.- activeLayer(self) QgsMapLayer ¶
Returns the current active layer.
See also
New in version 3.14.
- Return type
- browserModel(self) QgsBrowserGuiModel ¶
Returns the browser model associated with the widget.
See also
New in version 3.12.
- Return type
- mapCanvas(self) QgsMapCanvas ¶
Returns the map canvas associated with the widget.
See also
- Return type
- messageBar(self) QgsMessageBar ¶
Returns the message bar associated with the widget. This allows the widget to push feedback messages to the user.
See also
New in version 3.12.
- Return type
- model(self) QgsProcessingModelAlgorithm ¶
Returns the model which the parameter widget is associated with.
See also
See also
- Return type
- modelChildAlgorithmId(self) str ¶
Returns the child algorithm ID within the model which the parameter widget is associated with.
See also
See also
- Return type
str
- project(self) QgsProject ¶
Returns the project associated with the widget.
See also
- Return type
- setActiveLayer(self, layer: QgsMapLayer)¶
Sets the current active
layer
.See also
New in version 3.14.
- Parameters
layer (QgsMapLayer) –
- setBrowserModel(self, model: QgsBrowserGuiModel)¶
Sets the browser
model
associated with the widget. This will usually be the shared app instance of the browser modelSee also
New in version 3.14.
- Parameters
model (QgsBrowserGuiModel) –
- 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
- Parameters
canvas (QgsMapCanvas) –
- setMessageBar(self, bar: QgsMessageBar)¶
Sets the message
bar
associated with the widget. This allows the widget to push feedback messages to the user.See also
New in version 3.12.
- Parameters
bar (QgsMessageBar) –
- setModel(self, model: QgsProcessingModelAlgorithm)¶
Sets the
model
which the parameter widget is associated with.See also
See also
- Parameters
model (QgsProcessingModelAlgorithm) –
- setModelChildAlgorithmId(self, id: str)¶
Sets the child algorithm
id
within the model which the parameter widget is associated with.See also
See also
- 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
New in version 3.8.
- Parameters
project (QgsProject) –