Skip to content

Commit 389435e

Browse files
authoredDec 2, 2017
Merge pull request #5729 from nyalldawson/proc_dyanmic
[processing] Expose dynamic ("data defined") numeric parameters to gui
2 parents 65a0c06 + 9378f39 commit 389435e

File tree

75 files changed

+391
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+391
-99
lines changed
 

‎python/core/processing/qgsprocessingalgorithm.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ class QgsProcessingFeatureBasedAlgorithm : QgsProcessingAlgorithm
872872
:rtype: QgsCoordinateReferenceSystem
873873
%End
874874

875-
virtual QgsFeature processFeature( const QgsFeature &feature, QgsProcessingFeedback *feedback ) = 0;
875+
virtual QgsFeature processFeature( const QgsFeature &feature, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) = 0;
876876
%Docstring
877877
Processes an individual input ``feature`` from the source. Algorithms should implement their
878878
logic in this method for performing the algorithm's operation (e.g. replacing the feature's

‎python/core/processing/qgsprocessingparameters.sip

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,69 @@ class QgsProcessingParameterDefinition
376376
:rtype: str
377377
%End
378378

379+
bool isDynamic() const;
380+
%Docstring
381+
Returns true if the parameter supports is dynamic, and can support data-defined values
382+
(i.e. QgsProperty based values).
383+
.. seealso:: setIsDynamic()
384+
.. seealso:: dynamicPropertyDefinition()
385+
.. seealso:: dynamicLayerParameterName()
386+
:rtype: bool
387+
%End
388+
389+
void setIsDynamic( bool dynamic );
390+
%Docstring
391+
Sets whether the parameter is ``dynamic``, and can support data-defined values
392+
(i.e. QgsProperty based values).
393+
.. seealso:: isDynamic()
394+
.. seealso:: setDynamicPropertyDefinition()
395+
.. seealso:: setDynamicLayerParameterName()
396+
%End
397+
398+
QgsPropertyDefinition dynamicPropertyDefinition() const;
399+
%Docstring
400+
Returns the property definition for dynamic properties.
401+
.. seealso:: isDynamic()
402+
.. seealso:: setDynamicPropertyDefinition()
403+
.. seealso:: dynamicLayerParameterName()
404+
:rtype: QgsPropertyDefinition
405+
%End
406+
407+
void setDynamicPropertyDefinition( const QgsPropertyDefinition &definition );
408+
%Docstring
409+
Sets the property ``definition`` for dynamic properties.
410+
.. seealso:: isDynamic()
411+
.. seealso:: dynamicPropertyDefinition()
412+
.. seealso:: setDynamicLayerParameterName()
413+
%End
414+
415+
QString dynamicLayerParameterName() const;
416+
%Docstring
417+
Returns the name of the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
418+
419+
Dynamic parameters (see isDynamic()) can have an optional vector layer parameter linked to them,
420+
which indicates which layer the fields and values will be available from when evaluating
421+
the dynamic parameter.
422+
423+
.. seealso:: setDynamicLayerParameterName()
424+
.. seealso:: isDynamic()
425+
.. seealso:: dynamicPropertyDefinition()
426+
:rtype: str
427+
%End
428+
429+
void setDynamicLayerParameterName( const QString &name );
430+
%Docstring
431+
Sets the ``name`` for the parameter for a layer linked to a dynamic parameter, or an empty string if this is not set.
432+
433+
Dynamic parameters (see isDynamic()) can have an optional vector layer parameter linked to them,
434+
which indicates which layer the fields and values will be available from when evaluating
435+
the dynamic parameter.
436+
437+
.. seealso:: dynamicLayerParameterName()
438+
.. seealso:: isDynamic()
439+
.. seealso:: setDynamicPropertyDefinition()
440+
%End
441+
379442
protected:
380443

381444

@@ -385,6 +448,9 @@ class QgsProcessingParameterDefinition
385448

386449

387450

451+
452+
453+
388454
};
389455

390456
QFlags<QgsProcessingParameterDefinition::Flag> operator|(QgsProcessingParameterDefinition::Flag f1, QFlags<QgsProcessingParameterDefinition::Flag> f2);

0 commit comments

Comments
 (0)
Please sign in to comment.