|
QGIS API Documentation 4.3.0-Master (a9c95da348f)
|
A registry for widgets for use with the Processing framework. More...
#include <qgsprocessingguiregistry.h>

Public Member Functions | |
| QgsProcessingGuiRegistry () | |
| Constructor. | |
| ~QgsProcessingGuiRegistry () override | |
| void | addAlgorithmConfigurationWidgetFactory (QgsProcessingAlgorithmConfigurationWidgetFactory *factory) |
| Add a new configuration widget factory for customized algorithm configuration widgets. | |
| bool | addParameterWidgetFactory (QgsProcessingParameterWidgetFactoryInterface *factory) |
| Adds a parameter widget factory to the registry, allowing widget creation for parameters of the matching type via createParameterWidgetWrapper() and createModelerParameterWidget(). | |
| QgsProcessingAlgorithmConfigurationWidget * | algorithmConfigurationWidget (const QgsProcessingAlgorithm *algorithm) const |
| Gets the configuration widget for an algorithm. | |
| QgsProcessingModelConfigWidget * | createModelConfigWidgetForComponent (QgsProcessingModelComponent *component, QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext) const |
| Creates a new widget for configuring a Processing model component. | |
| QgsProcessingModelerParameterWidget * | createModelerParameterWidget (QgsProcessingModelAlgorithm *model, const QString &childId, const QgsProcessingParameterDefinition *parameter, QgsProcessingContext &context) |
| Creates a new modeler parameter widget for the given parameter. | |
| QgsProcessingAbstractParameterDefinitionWidget * | createParameterDefinitionWidget (const QString &type, QgsProcessingContext &context, const QgsProcessingParameterWidgetContext &widgetContext, const QgsProcessingParameterDefinition *definition=nullptr, const QgsProcessingAlgorithm *algorithm=nullptr) |
| Creates a new parameter definition widget allowing for configuration of an instance of a specific parameter type. | |
| QgsAbstractProcessingParameterWidgetWrapper * | createParameterWidgetWrapper (const QgsProcessingParameterDefinition *parameter, Qgis::ProcessingMode type) |
| Creates a new parameter widget wrapper for the given parameter. | |
| QgsProcessingParameterWidgetContext | createWidgetContext () override |
| Register a Processing widget context. | |
| void | deregisterProviderToolboxActions (const QString &providerId) |
| Deregisters all toolbox actions for a provider. | |
| Q_DECL_DEPRECATED void | deregisterProviderToolboxContextAction (QgsProcessingToolboxContextAction *action) |
| Deregisters a context menu action. | |
| void | deregisterProviderToolboxContextActions (const QString &providerId) |
| Deregisters all toolbox context menu actions for a provider. | |
| void | registerModelConfigWidgetFactory (QgsProcessingModelConfigWidgetFactory *factory) |
| Register a new factory class for creating panel widgets that can be shown in the Processing model designer dialog. | |
| void | registerProviderToolboxAction (const QString &providerId, QgsProcessingToolboxAction *action) |
| Registers a toolbox action for a provider. | |
| void | registerProviderToolboxContextAction (const QString &providerId, QgsProcessingToolboxContextAction *action) |
| Registers a toolbox context menu action for a provider. | |
| void | registerWidgetContextGenerator (QgsProcessingWidgetContextGenerator *generator) |
| Register a Processing widget context generator class that will be used to retrieve a widget context when required. | |
| void | removeAlgorithmConfigurationWidgetFactory (QgsProcessingAlgorithmConfigurationWidgetFactory *factory) |
| Remove a configuration widget factory for customized algorithm configuration widgets. | |
| void | removeParameterWidgetFactory (QgsProcessingParameterWidgetFactoryInterface *factory) |
| Removes a parameter widget factory from the registry. | |
| QList< QgsProcessingToolboxAction * > | toolboxActionsForProvider (const QString &providerId) const |
| Returns a list of all toolbox actions registered for a provider. | |
| QList< QgsProcessingToolboxContextAction * > | toolboxContextActions () const |
| Returns a list of all toolbox context menu actions registered. | |
| QList< QgsProcessingToolboxContextAction * > | toolboxContextActionsForProvider (const QString &providerId) const |
| Returns a list of all toolbox context menu actions registered for a provider. | |
| void | unregisterModelConfigWidgetFactory (QgsProcessingModelConfigWidgetFactory *factory) |
| Unregister a previously registered factory for creating panel widgets that can be shown in the Processing model designer dialog. | |
| Public Member Functions inherited from QgsProcessingWidgetContextGenerator | |
| virtual | ~QgsProcessingWidgetContextGenerator ()=default |
A registry for widgets for use with the Processing framework.
QgsProcessingGuiRegistry is not usually directly created, but rather accessed through QgsGui::processingGuiRegistry().
Definition at line 51 of file qgsprocessingguiregistry.h.
| QgsProcessingGuiRegistry::QgsProcessingGuiRegistry | ( | ) |
Constructor.
Should never be called manually, is already created by QgsGui.
Definition at line 53 of file qgsprocessingguiregistry.cpp.
|
override |
Definition at line 122 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::addAlgorithmConfigurationWidgetFactory | ( | QgsProcessingAlgorithmConfigurationWidgetFactory * | factory | ) |
Add a new configuration widget factory for customized algorithm configuration widgets.
Ownership is taken.
Definition at line 147 of file qgsprocessingguiregistry.cpp.
| bool QgsProcessingGuiRegistry::addParameterWidgetFactory | ( | QgsProcessingParameterWidgetFactoryInterface * | factory | ) |
Adds a parameter widget factory to the registry, allowing widget creation for parameters of the matching type via createParameterWidgetWrapper() and createModelerParameterWidget().
Ownership of factory is transferred to the registry.
Returns true if the factory was successfully added, or false if the factory could not be added. Each factory must return a unique value for QgsProcessingParameterWidgetFactoryInterface::parameterType(), and attempting to add a new factory with a duplicate type will result in failure.
Definition at line 174 of file qgsprocessingguiregistry.cpp.
| QgsProcessingAlgorithmConfigurationWidget * QgsProcessingGuiRegistry::algorithmConfigurationWidget | ( | const QgsProcessingAlgorithm * | algorithm | ) | const |
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, nullptr will be returned.
Definition at line 158 of file qgsprocessingguiregistry.cpp.
| QgsProcessingModelConfigWidget * QgsProcessingGuiRegistry::createModelConfigWidgetForComponent | ( | QgsProcessingModelComponent * | component, |
| QgsProcessingContext & | context, | ||
| const QgsProcessingParameterWidgetContext & | widgetContext ) const |
Creates a new widget for configuring a Processing model component.
May return nullptr if configuring a the component is not supported.
Definition at line 252 of file qgsprocessingguiregistry.cpp.
| QgsProcessingModelerParameterWidget * QgsProcessingGuiRegistry::createModelerParameterWidget | ( | QgsProcessingModelAlgorithm * | model, |
| const QString & | childId, | ||
| const QgsProcessingParameterDefinition * | parameter, | ||
| QgsProcessingContext & | context ) |
Creates a new modeler parameter widget for the given parameter.
This widget allows configuration of the parameter's value when used inside a Processing model.
The ID of the child algorithm within the model must be specified via the childId argument. This value corresponds to the QgsProcessingModelChildAlgorithm::childId() string, which uniquely identifies which child algorithm the parameter is associated with inside the given model.
The caller takes ownership of the returned widget. If no factory is registered which handles the given parameter, nullptr will be returned.
Definition at line 226 of file qgsprocessingguiregistry.cpp.
| QgsProcessingAbstractParameterDefinitionWidget * QgsProcessingGuiRegistry::createParameterDefinitionWidget | ( | const QString & | type, |
| QgsProcessingContext & | context, | ||
| const QgsProcessingParameterWidgetContext & | widgetContext, | ||
| const QgsProcessingParameterDefinition * | definition = nullptr, | ||
| const QgsProcessingAlgorithm * | algorithm = nullptr ) |
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 existing definition properties such as default values. Similarly, the widgetContext 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. If definition is nullptr, 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 nullptr is returned for a particular parameter type, it indicates that the parameter type cannot be configured via GUI.
Definition at line 241 of file qgsprocessingguiregistry.cpp.
| QgsAbstractProcessingParameterWidgetWrapper * QgsProcessingGuiRegistry::createParameterWidgetWrapper | ( | const QgsProcessingParameterDefinition * | parameter, |
| Qgis::ProcessingMode | type ) |
Creates a new parameter widget wrapper for the given parameter.
The type 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, nullptr will be returned.
Definition at line 208 of file qgsprocessingguiregistry.cpp.
|
overridevirtual |
Register a Processing widget context.
Implements QgsProcessingWidgetContextGenerator.
Definition at line 276 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::deregisterProviderToolboxActions | ( | const QString & | providerId | ) |
Deregisters all toolbox actions for a provider.
Any previously registered actions for this provider will be deleted.
Definition at line 290 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::deregisterProviderToolboxContextAction | ( | QgsProcessingToolboxContextAction * | action | ) |
Deregisters a context menu action.
The action will not be deleted, ownership will be returned to Python.
Definition at line 312 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::deregisterProviderToolboxContextActions | ( | const QString & | providerId | ) |
Deregisters all toolbox context menu actions for a provider.
Any previously registered actions for this provider will be deleted.
Definition at line 306 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::registerModelConfigWidgetFactory | ( | QgsProcessingModelConfigWidgetFactory * | factory | ) |
Register a new factory class for creating panel widgets that can be shown in the Processing model designer dialog.
Definition at line 198 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::registerProviderToolboxAction | ( | const QString & | providerId, |
| QgsProcessingToolboxAction * | action ) |
Registers a toolbox action for a provider.
Ownership of action is transferred to the registry.
Definition at line 285 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::registerProviderToolboxContextAction | ( | const QString & | providerId, |
| QgsProcessingToolboxContextAction * | action ) |
Registers a toolbox context menu action for a provider.
Ownership of action is transferred to the registry.
Definition at line 301 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::registerWidgetContextGenerator | ( | QgsProcessingWidgetContextGenerator * | generator | ) |
Register a Processing widget context generator class that will be used to retrieve a widget context when required.
nullptr argument to de-register the generator.Definition at line 271 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::removeAlgorithmConfigurationWidgetFactory | ( | QgsProcessingAlgorithmConfigurationWidgetFactory * | factory | ) |
Remove a configuration widget factory for customized algorithm configuration widgets.
Definition at line 152 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::removeParameterWidgetFactory | ( | QgsProcessingParameterWidgetFactoryInterface * | factory | ) |
Removes a parameter widget factory from the registry.
The factory will be deleted.
Definition at line 189 of file qgsprocessingguiregistry.cpp.
| QList< QgsProcessingToolboxAction * > QgsProcessingGuiRegistry::toolboxActionsForProvider | ( | const QString & | providerId | ) | const |
Returns a list of all toolbox actions registered for a provider.
Definition at line 296 of file qgsprocessingguiregistry.cpp.
| QList< QgsProcessingToolboxContextAction * > QgsProcessingGuiRegistry::toolboxContextActions | ( | ) | const |
Returns a list of all toolbox context menu actions registered.
Definition at line 326 of file qgsprocessingguiregistry.cpp.
| QList< QgsProcessingToolboxContextAction * > QgsProcessingGuiRegistry::toolboxContextActionsForProvider | ( | const QString & | providerId | ) | const |
Returns a list of all toolbox context menu actions registered for a provider.
Definition at line 336 of file qgsprocessingguiregistry.cpp.
| void QgsProcessingGuiRegistry::unregisterModelConfigWidgetFactory | ( | QgsProcessingModelConfigWidgetFactory * | factory | ) |
Unregister a previously registered factory for creating panel widgets that can be shown in the Processing model designer dialog.
Definition at line 203 of file qgsprocessingguiregistry.cpp.