[Qgis-developer] Support for QGIS variables in Processing

Victor Olaya volayaf at gmail.com
Wed Apr 6 05:49:48 PDT 2016


Hi all

I am trying to add support for QGIS variables in Processing, since
that can be a useful functionality. To start with, I want to add it to
scripts, so you can use the @variable syntax in Processing scripts as
well

It is easy to implement that, but the scope here is not so clear as in
other places in QGIS where variables are used. It would be nice to
have the project scope, but also the layer scope of the layers that
are used are input. I was thinking of using @variable for the project
scope and layername at variable for the layer scope, but before
introducing a new notation, I would like to get ideas and feedback
from you.

Of course, people writing scripts can get variables using the
QgsExpressionContextScope class...but i want to make it easier and
have it documented for script developers that do not want to  having
to dive in the QGIS API docs...

Please, feel free to comment and tell me what you think of this idea,
and how you think it would be better to implement it. In a second
step, support might be added to the algorithm dialogs, so inputs such
as numbers or strings can be entered using variables.

Thanks in advance!


More information about the Qgis-developer mailing list