Class: QgsProcessingGuiRegistry¶
-
class
qgis.gui.
QgsProcessingGuiRegistry
¶ Bases:
sip.wrapper
Constructor. Should never be called manually, is already created by
QgsGui
.QgsProcessingGuiRegistry(
QgsProcessingGuiRegistry
)The
QgsProcessingGuiRegistry
is a home for widgets for processing configuration widgets.QgsProcessingGuiRegistry
is not usually directly created, but rather accessed throughQgsGui.processingGuiRegistry()
.Methods
Add a new configuration widget factory for customized algorithm configuration widgets.
Adds a parameter widget
factory
to the registry, allowing widget creation for parameters of the matching type viacreateParameterWidgetWrapper()
andcreateModelerParameterWidget()
.Gets the configuration widget for an
algorithm
.Creates a new modeler parameter widget for the given
parameter
.Creates a new parameter definition widget allowing for configuration of an instance of a specific parameter
type
.Creates a new parameter widget wrapper for the given
parameter
.Remove a configuration widget factory for customized algorithm configuration widgets.
Removes a parameter widget
factory
from the registry.-
addAlgorithmConfigurationWidgetFactory
(self, factory: QgsProcessingAlgorithmConfigurationWidgetFactory)¶ Add a new configuration widget factory for customized algorithm configuration widgets. Ownership is taken.
New in version 3.2.
- Parameters
factory (QgsProcessingAlgorithmConfigurationWidgetFactory) –
-
addParameterWidgetFactory
(self, factory: QgsProcessingParameterWidgetFactoryInterface) → bool¶ Adds a parameter widget
factory
to the registry, allowing widget creation for parameters of the matching type viacreateParameterWidgetWrapper()
andcreateModelerParameterWidget()
.Ownership of
factory
is transferred to the registry.Returns
True
if the factory was successfully added, orFalse
if the factory could not be added. Each factory must return a unique value forQgsProcessingParameterWidgetFactoryInterface.parameterType()
, and attempting to add a new factory with a duplicate type will result in failure.See also
See also
See also
New in version 3.4.
- Parameters
factory (QgsProcessingParameterWidgetFactoryInterface) –
- Return type
bool
-
algorithmConfigurationWidget
(self, algorithm: QgsProcessingAlgorithm) → QgsProcessingAlgorithmConfigurationWidget¶ Gets the configuration widget for an
algorithm
. This widget will be shown next to parameter widgets. Most algorithms do not have a configuration widget and in this case,None
will be returned.New in version 3.2.
- Parameters
algorithm (QgsProcessingAlgorithm) –
- Return type
-
createModelerParameterWidget
(self, model: QgsProcessingModelAlgorithm, childId: str, parameter: QgsProcessingParameterDefinition, context: QgsProcessingContext) → QgsProcessingModelerParameterWidget¶ Creates a new modeler parameter widget for the given
parameter
. This widget allows configuration of the parameter’s value when used inside a Processingmodel
.The ID of the child algorithm within the model must be specified via the
childId
argument. This value corresponds to theQgsProcessingModelChildAlgorithm.childId()
string, which uniquely identifies which child algorithm the parameter is associated with inside the givenmodel
.The caller takes ownership of the returned widget. If no factory is registered which handles the given
parameter
,None
will be returned.See also
See also
New in version 3.4.
- Parameters
model (QgsProcessingModelAlgorithm) –
childId (str) –
parameter (QgsProcessingParameterDefinition) –
context (QgsProcessingContext) –
- Return type
-
createParameterDefinitionWidget
(self, type: str, context: QgsProcessingContext, widgetContext: QgsProcessingParameterWidgetContext, definition: QgsProcessingParameterDefinition = None, algorithm: QgsProcessingAlgorithm = None) → QgsProcessingAbstractParameterDefinitionWidget¶ Creates a new parameter definition widget allowing for configuration of an instance of a specific parameter
type
.The
context
argument must specify a Processing context, which will be used by the widget to evaluate existingdefinition
properties such as default values. Similarly, thewidgetContext
argument specifies the wider GUI context in which the widget will be used.The optional
definition
argument may specify an existing parameter definition which will be reflected in the initial state of the returned widget. Ifdefinition
isNone
, then the returned widget will use default settings instead.Additionally, the optional
algorithm
parameter may be used to specify the algorithm or model associated with the parameter.If
None
is returned for a particular parametertype
, it indicates that the parameter type cannot be configured via GUI.New in version 3.10.
- Parameters
type (str) –
context (QgsProcessingContext) –
widgetContext (QgsProcessingParameterWidgetContext) –
definition (
QgsProcessingParameterDefinition
= None) –algorithm (
QgsProcessingAlgorithm
= None) –
- Return type
-
createParameterWidgetWrapper
(self, parameter: QgsProcessingParameterDefinition, type: QgsProcessingGui.WidgetType) → QgsAbstractProcessingParameterWidgetWrapper¶ Creates a new parameter widget wrapper for the given
parameter
. Thetype
argument dictates the type of dialog the wrapper should be created for. The caller takes ownership of the returned wrapper.If no factory is registered which handles the given
parameter
,None
will be returned.See also
See also
New in version 3.4.
- Parameters
parameter (QgsProcessingParameterDefinition) –
type (QgsProcessingGui.WidgetType) –
- Return type
-
removeAlgorithmConfigurationWidgetFactory
(self, factory: QgsProcessingAlgorithmConfigurationWidgetFactory)¶ Remove a configuration widget factory for customized algorithm configuration widgets.
New in version 3.2.
- Parameters
factory (QgsProcessingAlgorithmConfigurationWidgetFactory) –
-
removeParameterWidgetFactory
(self, factory: QgsProcessingParameterWidgetFactoryInterface)¶ Removes a parameter widget
factory
from the registry. The factory will be deleted.See also
New in version 3.4.
- Parameters
factory (QgsProcessingParameterWidgetFactoryInterface) –
-