File: qgsprocessingmodelerparameterwidget.sip.in

package info (click to toggle)
qgis 3.40.13%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,185,160 kB
  • sloc: cpp: 1,615,781; python: 372,865; xml: 23,474; sh: 3,761; perl: 3,664; ansic: 2,829; sql: 2,137; yacc: 1,068; lex: 577; javascript: 540; lisp: 411; makefile: 155
file content (190 lines) | stat: -rw-r--r-- 6,331 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/processing/qgsprocessingmodelerparameterwidget.h             *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/







class QgsProcessingModelerParameterWidget : QWidget, QgsExpressionContextGenerator
{
%Docstring(signature="appended")
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
:py:func:`QgsGui.processingGuiRegistry()`->:py:func:`~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
:py:func:`QgsProcessingParameterDefinition.type()` (for
``compatibleParameterTypes``) and the values for
:py:func:`QgsProcessingOutputDefinition.type()` (for
``compatibleOutputTypes``).

The ``compatibleDataTypes`` list corresponds to the compatible data
types from :py:class:`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"
expression 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
:py:func:`~QgsProcessingModelerParameterWidget.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;


    void setSourceType( Qgis::ProcessingModelChildParameterSource type );
%Docstring
Sets the current source ``type`` for the parameter.

.. versionadded:: 3.24
%End

};


/************************************************************************
 * This file has been generated automatically from                      *
 *                                                                      *
 * src/gui/processing/qgsprocessingmodelerparameterwidget.h             *
 *                                                                      *
 * Do not edit manually ! Edit header and run scripts/sipify.py again   *
 ************************************************************************/