mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
Added batch_number variable in algorithm scope to allow use it in the expression editor in Processing batch context
This commit is contained in:
parent
2001e0fcf5
commit
a4b9ef73fd
@ -217,6 +217,9 @@ class BatchPanelFillWidget(QToolButton):
|
||||
for k, v in params.items():
|
||||
alg_scope.setVariable(k, v, True)
|
||||
|
||||
# add batchCount in the alg scope to be used in the expressions. 0 is only an example value
|
||||
alg_scope.setVariable('batch_number', 0, True)
|
||||
|
||||
expression_context.appendScope(alg_scope)
|
||||
|
||||
# mark the parameter variables as highlighted for discoverability
|
||||
@ -253,6 +256,9 @@ class BatchPanelFillWidget(QToolButton):
|
||||
for k, v in params.items():
|
||||
alg_scope.setVariable(k, v, True)
|
||||
|
||||
# add batch row number as evaluable variable in algorithm scope
|
||||
alg_scope.setVariable('batch_number', row, True)
|
||||
|
||||
expression_context.appendScope(alg_scope)
|
||||
|
||||
# rebuild a new expression every time -- we don't want the expression compiler to replace
|
||||
|
Loading…
x
Reference in New Issue
Block a user