Class: QgsProcessingParameterDefinitionWidget¶
A widget which allow users to specify the properties of a Processing parameter.
Added in version 3.10.
Class Hierarchy¶
Base classes¶
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. |
- class qgis.gui.QgsProcessingParameterDefinitionWidget[source]¶
Bases:
QWidget- __init__(type: str | None, context: QgsProcessingContext, widgetContext: QgsProcessingParameterWidgetContext, definition: QgsProcessingParameterDefinition | None = None, algorithm: QgsProcessingAlgorithm | None = None, parent: QWidget | None = None)
Constructor for QgsProcessingParameterDefinitionWidget, for a parameter of the specified
type.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:
type (Optional[str])
context (QgsProcessingContext)
widgetContext (QgsProcessingParameterWidgetContext)
definition (Optional[QgsProcessingParameterDefinition] = None)
algorithm (Optional[QgsProcessingAlgorithm] = None)
parent (Optional[QWidget] = None)
- createParameter(self, name: str | None = '') QgsProcessingParameterDefinition | None[source]¶
Returns a new instance of a parameter definition, using the current settings defined in the dialog.
The
nameparameter specifies the name for the newly created parameter.- Parameters:
name (Optional[str] = '')
- 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])