Project: QGIS

Version: 2.12.0

Feature: Variables in expressions

You can now define custom variables for use in expressions. Variables can be defined at the application global level, project level, layer level and composition level. Just like CSS cascading rules, variables can be overwritten - eg, a project level variable will overwrite any application level variables set. You can use these variables to build text strings or other custom expressions. For example in composer creating a label with this content:

This map was made using QGIS [% @qgis_version %]. The project file for this map is: [% @project_path %]

Will render the label like this:

This map was made using QGIS 2.12. The project file for this map is: /gis/qgis-user-conference-2015.qgs

You can manage global variables from the Settings -> Options menu, and project level variables from Project properties (including adding your own custom variables).

This feature was developed by: Nyall Dawson