mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-09 00:35:20 -05:00
A new widget which handles parameter values for child algorithms within a model. Instead of the previous approach of requiring individual widget wrappers to handle creation of a suitable model widget, we do all this automatically for them. This widget uses a stacked widget with a toolbutton to select the parameter's source, instead of the previous combo box approach (which didn't scale well for large models). I.e. users select first whether the value is taken from a static value, a model input, or an output from a different child algorithm. The widget then changes appearance and behavior based on this choice. Additionally, a new option is present for all parameters of using a "precalculated expression". This expression is evaluated once before the child algorithm is executed and used during the execution of that algorithm.
137 lines
5.1 KiB
Plaintext
137 lines
5.1 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/processing/qgsprocessingguiregistry.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
class QgsProcessingGuiRegistry
|
|
{
|
|
%Docstring
|
|
The QgsProcessingGuiRegistry is a home for widgets for processing
|
|
configuration widgets.
|
|
|
|
QgsProcessingGuiRegistry is not usually directly created, but rather accessed through
|
|
:py:func:`QgsGui.processingGuiRegistry()`
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprocessingguiregistry.h"
|
|
%End
|
|
public:
|
|
|
|
QgsProcessingGuiRegistry();
|
|
%Docstring
|
|
Constructor. Should never be called manually, is already
|
|
created by :py:class:`QgsGui`.
|
|
%End
|
|
~QgsProcessingGuiRegistry();
|
|
|
|
void addAlgorithmConfigurationWidgetFactory( QgsProcessingAlgorithmConfigurationWidgetFactory *factory /Transfer/ );
|
|
%Docstring
|
|
Add a new configuration widget factory for customized algorithm configuration
|
|
widgets. Ownership is taken.
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
void removeAlgorithmConfigurationWidgetFactory( QgsProcessingAlgorithmConfigurationWidgetFactory *factory );
|
|
%Docstring
|
|
Remove a configuration widget factory for customized algorithm configuration
|
|
widgets.
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
QgsProcessingAlgorithmConfigurationWidget *algorithmConfigurationWidget( const QgsProcessingAlgorithm *algorithm ) const;
|
|
%Docstring
|
|
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.
|
|
|
|
.. versionadded:: 3.2
|
|
%End
|
|
|
|
bool addParameterWidgetFactory( QgsProcessingParameterWidgetFactoryInterface *factory /Transfer/ );
|
|
%Docstring
|
|
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.
|
|
|
|
.. seealso:: :py:func:`removeParameterWidgetFactory`
|
|
|
|
.. seealso:: :py:func:`createParameterWidgetWrapper`
|
|
|
|
.. seealso:: :py:func:`createModelerParameterWidget`
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
void removeParameterWidgetFactory( QgsProcessingParameterWidgetFactoryInterface *factory );
|
|
%Docstring
|
|
Removes a parameter widget ``factory`` from the registry. The factory will be deleted.
|
|
|
|
.. seealso:: :py:func:`addParameterWidgetFactory`
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
QgsAbstractProcessingParameterWidgetWrapper *createParameterWidgetWrapper( const QgsProcessingParameterDefinition *parameter, QgsProcessingGui::WidgetType type ) /Factory/;
|
|
%Docstring
|
|
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 None will be returned.
|
|
|
|
.. seealso:: :py:func:`createModelerParameterWidget`
|
|
|
|
.. seealso:: :py:func:`addParameterWidgetFactory`
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
QgsProcessingModelerParameterWidget *createModelerParameterWidget( QgsProcessingModelAlgorithm *model,
|
|
const QString &childId,
|
|
const QgsProcessingParameterDefinition *parameter, const QgsProcessingContext &context ) /Factory/;
|
|
%Docstring
|
|
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 :py:func:`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 None will be returned.
|
|
|
|
.. seealso:: :py:func:`createParameterWidgetWrapper`
|
|
|
|
.. seealso:: :py:func:`addParameterWidgetFactory`
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
};
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/processing/qgsprocessingguiregistry.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|