Class: QgsProcessingAbstractParameterDefinitionWidget¶
Abstract base class for widgets which allow users to specify the properties of a Processing parameter.
Added in version 3.10.
Class Hierarchy¶
Base classes¶
Abstract interface for generating an expression context. |
Methods
Returns a new instance of a parameter definition, using the current settings defined in the dialog. |
|
Registers a Processing context generator class that will be used to retrieve a Processing context for the widget when required. |
|
Sets the context in which the Processing definition 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. |
|
Returns the context in which the Processing definition 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. |
- class qgis.gui.QgsProcessingAbstractParameterDefinitionWidget[source]¶
Bases:
QWidget,QgsExpressionContextGenerator- __init__(context: QgsProcessingContext, widgetContext: QgsProcessingParameterWidgetContext, definition: QgsProcessingParameterDefinition | None = None, algorithm: QgsProcessingAlgorithm | None = None, parent: QWidget | None = None)
Creates a new QgsProcessingAbstractParameterDefinitionWidget, with the specified
parentwidget.The
contextargument must specify a Processing context, which will be used by the widget to evaluate existingdefinitionproperties such as default values. Similarly, thewidgetContextargument specifies the wider GUI context in which the widget will be used.The optional
definitionargument may be used to provide a parameter definition to use to initially populate the widget’s state.Additionally, the optional
algorithmparameter may be used to specify the algorithm or model associated with the parameter.- Parameters:
context (QgsProcessingContext)
widgetContext (QgsProcessingParameterWidgetContext)
definition (Optional[QgsProcessingParameterDefinition] = None)
algorithm (Optional[QgsProcessingAlgorithm] = None)
parent (Optional[QWidget] = None)
- createParameter(self, name: str | None, description: str | None, flags: Qgis.ProcessingParameterFlags | Qgis.ProcessingParameterFlag) QgsProcessingParameterDefinition | None[source]¶
Returns a new instance of a parameter definition, using the current settings defined in the dialog.
Common properties for parameters, including the
name,description, and parameterflagsare passed to the method. Subclass implementations must use these properties when crafting a parameter definition which also respects the additional properties specific to the parameter type handled by the widget subclass.- Parameters:
name (Optional[str])
description (Optional[str])
flags (Union[Qgis.ProcessingParameterFlags, Qgis.ProcessingParameterFlag])
- Return type:
Optional[QgsProcessingParameterDefinition]
- 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.Added in version 3.18.
- Parameters:
generator (Optional[QgsProcessingContextGenerator])
- setWidgetContext(self, context: QgsProcessingParameterWidgetContext)[source]¶
Sets the
contextin which the Processing definition 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.Subclasses should take care to call the base class method when reimplementing this method.
See also
Added in version 3.18.
- Parameters:
context (QgsProcessingParameterWidgetContext)
- widgetContext(self) QgsProcessingParameterWidgetContext¶
Returns the context in which the Processing definition 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.
See also
Added in version 3.18.
- Return type: