Class: QgsProcessingParameterWidgetContext¶
Contains settings which reflect the context in which a Processing parameter widget is shown.
For instance, 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.
List of all members, including inherited members
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 associated model designer dialog, if applicable. |
|
Returns the Processing context generator class that will be used to retrieve a Processing context for the widget when required. |
|
Returns the project associated with the widget. |
|
Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required. |
|
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 associated model designer dialog, if applicable. |
|
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:
QgsMapLayer|None
- browserModel(self) QgsBrowserGuiModel | None[source]¶
Returns the browser model associated with the widget.
See also
Added in version 3.12.
- Return type:
QgsBrowserGuiModel|None
- mapCanvas(self) QgsMapCanvas | None[source]¶
Returns the map canvas associated with the widget.
See also
- Return type:
QgsMapCanvas|None
- 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:
QgsMessageBar|None
- model(self) QgsProcessingModelAlgorithm | None[source]¶
Returns the model which the parameter widget is associated with.
See also
See also
- Return type:
- 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
- modelDesignerDialog(self) QgsModelDesignerDialog | None[source]¶
Returns the associated model designer dialog, if applicable.
Warning
This method is not considered stable API
See also
Added in version 4.0.
- Return type:
- processingContextGenerator(self) QgsProcessingContextGenerator | None[source]¶
Returns the Processing context generator class that will be used to retrieve a Processing context for the widget when required.
See also
Added in version 4.0.
- Return type:
- project(self) QgsProject | None[source]¶
Returns the project associated with the widget.
See also
- Return type:
QgsProject|None
- registerProcessingContextGenerator(self, generator: QgsProcessingContextGenerator | None)[source]¶
Registers a Processing context
generatorclass that will be used to retrieve a Processing context for the widget when required.The
generatormust exist for the lifetime of the widget, ownership is not transferred.See also
Added in version 4.0.
- Parameters:
generator (QgsProcessingContextGenerator|None)
- setActiveLayer(self, layer: QgsMapLayer | None)[source]¶
Sets the current active
layer.See also
Added in version 3.14.
- Parameters:
layer (QgsMapLayer|None)
- setBrowserModel(self, model: QgsBrowserGuiModel | None)[source]¶
Sets the browser
modelassociated with the widget. This will usually be the shared app instance of the browser modelSee also
Added in version 3.14.
- Parameters:
model (QgsBrowserGuiModel|None)
- setMapCanvas(self, canvas: QgsMapCanvas | None)[source]¶
Sets the map
canvasassociated with the widget. This allows the widget to retrieve the current map scale and other properties from the canvas.See also
- Parameters:
canvas (QgsMapCanvas|None)
- setMessageBar(self, bar: QgsMessageBar | None)[source]¶
Sets the message
barassociated with the widget. This allows the widget to push feedback messages to the user.See also
Added in version 3.12.
- Parameters:
bar (QgsMessageBar|None)
- setModel(self, model: QgsProcessingModelAlgorithm | None)[source]¶
Sets the
modelwhich the parameter widget is associated with.See also
See also
- Parameters:
model (QgsProcessingModelAlgorithm|None)
- setModelChildAlgorithmId(self, id: str | None)[source]¶
Sets the child algorithm
idwithin the model which the parameter widget is associated with.See also
See also
- Parameters:
id (str|None)
- setModelDesignerDialog(self, dialog: QgsModelDesignerDialog | None)[source]¶
Sets the associated model designer
dialog, if applicable.Warning
This method is not considered stable API
See also
Added in version 4.0.
- Parameters:
dialog (QgsModelDesignerDialog|None)
- setProject(self, project: QgsProject | None)[source]¶
Sets the
projectassociated 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 (QgsProject|None)