mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
This allows a range of new possibilities, including: - models with static outputs for child algorithms, e.g. always saving a child algorithm's output to a geopackage or postgres layer - models with expression based output values for child algorithms, e.g. generating an automatic file name based on today's date and saving outputs to that file
186 lines
6.1 KiB
Plaintext
186 lines
6.1 KiB
Plaintext
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/processing/qgsprocessingmodelerparameterwidget.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QgsProcessingModelerParameterWidget : QWidget, QgsExpressionContextGenerator
|
|
{
|
|
%Docstring
|
|
|
|
A widget for customising the value of Processing algorithm parameter inside
|
|
a Processing model.
|
|
|
|
The widget provides choice of the linked source for values for the parameter
|
|
inside the model. E.g. parameters can be a static value, an evaluated
|
|
expression results, the output from another child algorithm, or an input
|
|
parameter for the model itself.
|
|
|
|
Individual modeler parameter widgets are not usually created directly, instead they are
|
|
constructed through the central registry, via calls to
|
|
QgsGui.processingGuiRegistry()->createModelerParameterWidget().
|
|
|
|
.. versionadded:: 3.4
|
|
%End
|
|
|
|
%TypeHeaderCode
|
|
#include "qgsprocessingmodelerparameterwidget.h"
|
|
%End
|
|
public:
|
|
|
|
QgsProcessingModelerParameterWidget( QgsProcessingModelAlgorithm *model,
|
|
const QString &childId,
|
|
const QgsProcessingParameterDefinition *parameter,
|
|
QgsProcessingContext &context,
|
|
QWidget *parent /TransferThis/ = 0 );
|
|
%Docstring
|
|
Constructor for QgsProcessingModelerParameterWidget, for the specified
|
|
``parameter`` definition within the given ``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``.
|
|
|
|
A Processing ``context`` must also be specified, which allows the widget
|
|
to resolve parameter values which are context dependent. The context must
|
|
last for the lifetime of the widget.
|
|
%End
|
|
|
|
~QgsProcessingModelerParameterWidget();
|
|
|
|
void setWidgetContext( const QgsProcessingParameterWidgetContext &context );
|
|
%Docstring
|
|
Sets the ``context`` in which the modeler parameter widget is shown, e.g., the
|
|
parent model algorithm and other relevant information which allows the widget
|
|
to fine-tune its behavior.
|
|
%End
|
|
|
|
void registerProcessingContextGenerator( QgsProcessingContextGenerator *generator );
|
|
%Docstring
|
|
Registers a Processing context ``generator`` class that will be used to retrieve
|
|
a Processing context for the widget when required.
|
|
%End
|
|
|
|
void populateSources( const QStringList &compatibleParameterTypes,
|
|
const QStringList &compatibleOutputTypes,
|
|
const QList< int > &compatibleDataTypes );
|
|
%Docstring
|
|
Populates the widget with available sources for the parameter's value, e.g.
|
|
adding the available child algorithm outputs and model input parameter
|
|
choices.
|
|
|
|
In order to determine the available source, the ``compatibleParameterTypes`` and
|
|
``compatibleOutputTypes`` arguments are used. These lists correspond to the
|
|
various available values for QgsProcessingParameterDefinition.type() (for
|
|
``compatibleParameterTypes``) and the values for :py:func:`QgsProcessingOutputDefinition.type()`
|
|
(for ``compatibleOutputTypes``).
|
|
|
|
The ``compatibleDataTypes`` list corresponds to the compatible data types
|
|
from QgsProcessing.SourceType.
|
|
%End
|
|
|
|
void setExpressionHelpText( const QString &text );
|
|
%Docstring
|
|
Set the expected expression format ``text``, which is shown in the expression builder dialog for the widget
|
|
when in the "pre-calculated" ex pression mode. This is purely a text format and no expression validation is made
|
|
against it.
|
|
%End
|
|
|
|
const QgsProcessingParameterDefinition *parameterDefinition() const;
|
|
%Docstring
|
|
Returns the parameter definition associated with this wrapper.
|
|
%End
|
|
|
|
QLabel *createLabel() /Factory/;
|
|
%Docstring
|
|
Creates a label for use identifying the associated parameter.
|
|
|
|
The caller takes ownership of the returned value.
|
|
%End
|
|
|
|
virtual void setWidgetValue( const QgsProcessingModelChildParameterSource &value );
|
|
%Docstring
|
|
Sets the current ``value`` for the parameter.
|
|
|
|
.. seealso:: :py:func:`value`
|
|
%End
|
|
|
|
void setWidgetValue( const QList< QgsProcessingModelChildParameterSource > &values );
|
|
%Docstring
|
|
Sets the current ``values`` for the parameter.
|
|
|
|
.. seealso:: :py:func:`value`
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
void setToModelOutput( const QString &value );
|
|
%Docstring
|
|
Sets the widget to a model output, for destination parameters only.
|
|
|
|
.. seealso:: :py:func:`isModelOutput`
|
|
|
|
.. seealso:: :py:func:`modelOutputName`
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
bool isModelOutput() const;
|
|
%Docstring
|
|
Returns ``True`` if the widget is set to the model output mode.
|
|
|
|
.. seealso:: :py:func:`setToModelOutput`
|
|
|
|
.. seealso:: :py:func:`modelOutputName`
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
QString modelOutputName() const;
|
|
%Docstring
|
|
Returns the model output name, if isModelOutput() is ``True``.
|
|
|
|
.. seealso:: :py:func:`setToModelOutput`
|
|
|
|
.. seealso:: :py:func:`isModelOutput`
|
|
|
|
.. versionadded:: 3.14
|
|
%End
|
|
|
|
virtual QVariant value() const;
|
|
%Docstring
|
|
Returns the current value of the parameter.
|
|
|
|
.. seealso:: :py:func:`setWidgetValue`
|
|
%End
|
|
|
|
void setDialog( QDialog *dialog );
|
|
%Docstring
|
|
Sets the parent ``dialog`` in which the widget is shown.
|
|
|
|
.. versionadded:: 3.8
|
|
%End
|
|
|
|
virtual QgsExpressionContext createExpressionContext() const;
|
|
|
|
|
|
};
|
|
|
|
|
|
/************************************************************************
|
|
* This file has been generated automatically from *
|
|
* *
|
|
* src/gui/processing/qgsprocessingmodelerparameterwidget.h *
|
|
* *
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
************************************************************************/
|