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