QGIS API Documentation  3.4.3-Madeira (2f64a3c)
Public Member Functions | List of all members
QgsProcessingGuiRegistry Class Reference

The QgsProcessingGuiRegistry is a home for widgets for processing configuration widgets. More...

#include <qgsprocessingguiregistry.h>

Public Member Functions

 QgsProcessingGuiRegistry ()
 Constructor. More...
 
 ~QgsProcessingGuiRegistry ()
 
void addAlgorithmConfigurationWidgetFactory (QgsProcessingAlgorithmConfigurationWidgetFactory *factory)
 Add a new configuration widget factory for customized algorithm configuration widgets. More...
 
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(). More...
 
QgsProcessingAlgorithmConfigurationWidgetalgorithmConfigurationWidget (const QgsProcessingAlgorithm *algorithm) const
 Gets the configuration widget for an algorithm. More...
 
QgsProcessingModelerParameterWidgetcreateModelerParameterWidget (QgsProcessingModelAlgorithm *model, const QString &childId, const QgsProcessingParameterDefinition *parameter, QgsProcessingContext &context)
 Creates a new modeler parameter widget for the given parameter. More...
 
QgsAbstractProcessingParameterWidgetWrappercreateParameterWidgetWrapper (const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type)
 Creates a new parameter widget wrapper for the given parameter. More...
 
void removeAlgorithmConfigurationWidgetFactory (QgsProcessingAlgorithmConfigurationWidgetFactory *factory)
 Remove a configuration widget factory for customized algorithm configuration widgets. More...
 
void removeParameterWidgetFactory (QgsProcessingParameterWidgetFactoryInterface *factory)
 Removes a parameter widget factory from the registry. More...
 

Detailed Description

The QgsProcessingGuiRegistry is a home for widgets for processing configuration widgets.

QgsProcessingGuiRegistry is not usually directly created, but rather accessed through QgsGui::processingGuiRegistry().

Since
QGIS 3.2

Definition at line 43 of file qgsprocessingguiregistry.h.

Constructor & Destructor Documentation

◆ QgsProcessingGuiRegistry()

QgsProcessingGuiRegistry::QgsProcessingGuiRegistry ( )

Constructor.

Should never be called manually, is already created by QgsGui.

Definition at line 26 of file qgsprocessingguiregistry.cpp.

◆ ~QgsProcessingGuiRegistry()

QgsProcessingGuiRegistry::~QgsProcessingGuiRegistry ( )

Definition at line 38 of file qgsprocessingguiregistry.cpp.

Member Function Documentation

◆ addAlgorithmConfigurationWidgetFactory()

void QgsProcessingGuiRegistry::addAlgorithmConfigurationWidgetFactory ( QgsProcessingAlgorithmConfigurationWidgetFactory factory)

Add a new configuration widget factory for customized algorithm configuration widgets.

Ownership is taken.

Since
QGIS 3.2

Definition at line 48 of file qgsprocessingguiregistry.cpp.

◆ addParameterWidgetFactory()

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.

See also
removeParameterWidgetFactory()
createParameterWidgetWrapper()
createModelerParameterWidget()
Since
QGIS 3.4

Definition at line 72 of file qgsprocessingguiregistry.cpp.

◆ algorithmConfigurationWidget()

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.

Since
QGIS 3.2

Definition at line 59 of file qgsprocessingguiregistry.cpp.

◆ createModelerParameterWidget()

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, a nullptr will be returned.

See also
createParameterWidgetWrapper()
addParameterWidgetFactory()
Since
QGIS 3.4

Definition at line 108 of file qgsprocessingguiregistry.cpp.

◆ createParameterWidgetWrapper()

QgsAbstractProcessingParameterWidgetWrapper * QgsProcessingGuiRegistry::createParameterWidgetWrapper ( const QgsProcessingParameterDefinition parameter,
QgsProcessingGui::WidgetType  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, a nullptr will be returned.

See also
createModelerParameterWidget()
addParameterWidgetFactory()
Since
QGIS 3.4

Definition at line 96 of file qgsprocessingguiregistry.cpp.

◆ removeAlgorithmConfigurationWidgetFactory()

void QgsProcessingGuiRegistry::removeAlgorithmConfigurationWidgetFactory ( QgsProcessingAlgorithmConfigurationWidgetFactory factory)

Remove a configuration widget factory for customized algorithm configuration widgets.

Since
QGIS 3.2

Definition at line 53 of file qgsprocessingguiregistry.cpp.

◆ removeParameterWidgetFactory()

void QgsProcessingGuiRegistry::removeParameterWidgetFactory ( QgsProcessingParameterWidgetFactoryInterface factory)

Removes a parameter widget factory from the registry.

The factory will be deleted.

See also
addParameterWidgetFactory()
Since
QGIS 3.4

Definition at line 87 of file qgsprocessingguiregistry.cpp.


The documentation for this class was generated from the following files: