QGIS API Documentation
2.12.0-Lyon
|
Contains utilities for working with QgsExpressionContext objects, including methods for creating scopes for specific uses (eg project scopes, layer scopes). More...
#include <qgsexpressioncontext.h>
Static Public Member Functions | |
static QgsExpressionContextScope * | atlasScope (const QgsAtlasComposition *atlas) |
Creates a new scope which contains variables and functions relating to a QgsAtlasComposition. More... | |
static QgsExpressionContextScope * | composerItemScope (const QgsComposerItem *composerItem) |
Creates a new scope which contains variables and functions relating to a QgsComposerItem. More... | |
static QgsExpressionContextScope * | compositionScope (const QgsComposition *composition) |
Creates a new scope which contains variables and functions relating to a QgsComposition. More... | |
static QgsExpressionContext | createFeatureBasedContext (const QgsFeature &feature, const QgsFields &fields) |
Helper function for creating an expression context which contains just a feature and fields collection. More... | |
static QgsExpressionContextScope * | globalScope () |
Creates a new scope which contains variables and functions relating to the global QGIS context. More... | |
static QgsExpressionContextScope * | layerScope (const QgsMapLayer *layer) |
Creates a new scope which contains variables and functions relating to a QgsMapLayer. More... | |
static QgsExpressionContextScope * | mapSettingsScope (const QgsMapSettings &mapSettings) |
Creates a new scope which contains variables and functions relating to a QgsMapSettings object. More... | |
static QgsExpressionContextScope * | projectScope () |
Creates a new scope which contains variables and functions relating to the current QGIS project. More... | |
static void | registerContextFunctions () |
Registers all known core functions provided by QgsExpressionContextScope objects. More... | |
static void | setComposerItemVariable (QgsComposerItem *composerItem, const QString &name, const QVariant &value) |
Sets a composer item context variable. More... | |
static void | setComposerItemVariables (QgsComposerItem *composerItem, const QgsStringMap &variables) |
Sets all composition context variables. More... | |
static void | setCompositionVariable (QgsComposition *composition, const QString &name, const QVariant &value) |
Sets a composition context variable. More... | |
static void | setCompositionVariables (QgsComposition *composition, const QgsStringMap &variables) |
Sets all composition context variables. More... | |
static void | setGlobalVariable (const QString &name, const QVariant &value) |
Sets a global context variable. More... | |
static void | setGlobalVariables (const QgsStringMap &variables) |
Sets all global context variables. More... | |
static void | setLayerVariable (QgsMapLayer *layer, const QString &name, const QVariant &value) |
Sets a layer context variable. More... | |
static void | setLayerVariables (QgsMapLayer *layer, const QgsStringMap &variables) |
Sets all layer context variables. More... | |
static void | setProjectVariable (const QString &name, const QVariant &value) |
Sets a project context variable. More... | |
static void | setProjectVariables (const QgsStringMap &variables) |
Sets all project context variables. More... | |
Contains utilities for working with QgsExpressionContext objects, including methods for creating scopes for specific uses (eg project scopes, layer scopes).
Definition at line 438 of file qgsexpressioncontext.h.
|
static |
Creates a new scope which contains variables and functions relating to a QgsAtlasComposition.
For instance, current page name and number.
atlas | source atlas. If null, a set of default atlas variables will be added to the scope. |
Definition at line 766 of file qgsexpressioncontext.cpp.
|
static |
Creates a new scope which contains variables and functions relating to a QgsComposerItem.
For instance, item size and position.
composerItem | source composer item |
Definition at line 803 of file qgsexpressioncontext.cpp.
|
static |
Creates a new scope which contains variables and functions relating to a QgsComposition.
For instance, number of pages and page sizes.
composition | source composition |
Definition at line 700 of file qgsexpressioncontext.cpp.
|
static |
Helper function for creating an expression context which contains just a feature and fields collection.
Generally this method should not be used as the created context does not include standard scopes such as the global and project scopes.
Definition at line 868 of file qgsexpressioncontext.cpp.
|
static |
Creates a new scope which contains variables and functions relating to the global QGIS context.
For instance, QGIS version numbers and variables specified through QGIS options.
Definition at line 430 of file qgsexpressioncontext.cpp.
|
static |
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
For instance, layer name, id and fields.
Definition at line 614 of file qgsexpressioncontext.cpp.
|
static |
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
For instance, map scale and rotation.
Definition at line 688 of file qgsexpressioncontext.cpp.
|
static |
Creates a new scope which contains variables and functions relating to the current QGIS project.
For instance, project path and title, and variables specified through the project properties.
Definition at line 548 of file qgsexpressioncontext.cpp.
|
static |
Registers all known core functions provided by QgsExpressionContextScope objects.
Definition at line 876 of file qgsexpressioncontext.cpp.
|
static |
Sets a composer item context variable.
This variable will be contained within scopes retrieved via composerItemScope().
composerItem | target composer item |
name | variable name |
value | variable value |
Definition at line 834 of file qgsexpressioncontext.cpp.
|
static |
Sets all composition context variables.
Existing compositoin variables will be removed and replaced with the variables specified.
composerItem | target composer item |
variables | new set of layer variables |
Definition at line 850 of file qgsexpressioncontext.cpp.
|
static |
Sets a composition context variable.
This variable will be contained within scopes retrieved via compositionScope().
composition | target composition |
name | variable name |
value | variable value |
Definition at line 732 of file qgsexpressioncontext.cpp.
|
static |
Sets all composition context variables.
Existing composition variables will be removed and replaced with the variables specified.
composition | target composition |
variables | new set of layer variables |
Definition at line 748 of file qgsexpressioncontext.cpp.
|
static |
Sets a global context variable.
This variable will be contained within scopes retrieved via globalScope().
name | variable name |
value | variable value |
Definition at line 467 of file qgsexpressioncontext.cpp.
|
static |
Sets all global context variables.
Existing global variables will be removed and replaced with the variables specified.
variables | new set of global variables |
Definition at line 482 of file qgsexpressioncontext.cpp.
|
static |
Sets a layer context variable.
This variable will be contained within scopes retrieved via layerScope().
layer | map layer |
name | variable name |
value | variable value |
Definition at line 654 of file qgsexpressioncontext.cpp.
|
static |
Sets all layer context variables.
Existing layer variables will be removed and replaced with the variables specified.
layer | map layer |
variables | new set of layer variables |
Definition at line 670 of file qgsexpressioncontext.cpp.
|
static |
Sets a project context variable.
This variable will be contained within scopes retrieved via projectScope().
name | variable name |
value | variable value |
Definition at line 581 of file qgsexpressioncontext.cpp.
|
static |
Sets all project context variables.
Existing project variables will be removed and replaced with the variables specified.
variables | new set of project variables |
Definition at line 596 of file qgsexpressioncontext.cpp.