15 #ifndef QGSEXPRESSIONCONTEXTUTILS_H 16 #define QGSEXPRESSIONCONTEXTUTILS_H 18 #include "qgis_core.h" 24 #include <QVariantMap> 33 class QgsProcessingModelAlgorithm;
73 static void setGlobalVariable(
const QString &name,
const QVariant &value );
83 static void setGlobalVariables(
const QVariantMap &variables );
92 static void removeGlobalVariable(
const QString &name );
112 static void setProjectVariable(
QgsProject *project,
const QString &name,
const QVariant &value );
123 static void setProjectVariables(
QgsProject *project,
const QVariantMap &variables );
133 static void removeProjectVariable(
QgsProject *project,
const QString &name );
145 static QList<QgsExpressionContextScope *> globalProjectLayerScopes(
const QgsMapLayer *layer )
SIP_FACTORY;
156 static void setLayerVariable(
QgsMapLayer *layer,
const QString &name,
const QVariant &value );
166 static void setLayerVariables(
QgsMapLayer *layer,
const QVariantMap &variables );
207 static void setLayoutVariable(
QgsLayout *layout,
const QString &name,
const QVariant &value );
218 static void setLayoutVariables(
QgsLayout *layout,
const QVariantMap &variables );
244 static void setLayoutItemVariable(
QgsLayoutItem *item,
const QString &name,
const QVariant &value );
253 static void setLayoutItemVariables(
QgsLayoutItem *item,
const QVariantMap &variables );
271 static void setLayoutMultiFrameVariable(
QgsLayoutMultiFrame *frame,
const QString &name,
const QVariant &value );
280 static void setLayoutMultiFrameVariables(
QgsLayoutMultiFrame *frame,
const QVariantMap &variables );
314 static void registerContextFunctions();
321 GetLayerVisibility(
const QList<QgsMapLayer *> &layers,
double scale = 0 );
326 GetLayerVisibility();
328 QList< QPointer< QgsMapLayer > > mLayers;
329 QMap< QPointer< QgsMapLayer >, QPair< double, double > > mScaleBasedVisibilityDetails;
359 : mContext( context )
361 mContext.appendScope( scope );
366 delete mContext.popScope();
374 #endif // QGSEXPRESSIONCONTEXTUTILS_H Class for parsing and evaluation of expressions (formerly called "search strings").
Base class for all map layer types.
Base class for graphical items within a QgsLayout.
Abstract base class for all rendered symbols.
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Abstract base class for processing algorithms.
Abstract base class for layout items with the ability to distribute the content to several frames (Qg...
The QgsMapSettings class contains configuration for rendering of the map.
Layout graphical items for displaying a map.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Single scope for storing variables and functions for use within a QgsExpressionContext.
An expression node for expression functions.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into allowing algorithms to be written in pure substantial changes are required in order to port existing x Processing algorithms for QGIS x The most significant changes are outlined not GeoAlgorithm For algorithms which operate on features one by consider subclassing the QgsProcessingFeatureBasedAlgorithm class This class allows much of the boilerplate code for looping over features from a vector layer to be bypassed and instead requires implementation of a processFeature method Ensure that your algorithm(or algorithm 's parent class) implements the new pure virtual createInstance(self) call
Contains utilities for working with QgsExpressionContext objects, including methods for creating scop...
QgsExpressionContextScopePopper(QgsExpressionContext &context, QgsExpressionContextScope *scope)
Constructor for QgsExpressionContextScopePopper.
Contains information about the context in which a processing algorithm is executed.
~QgsExpressionContextScopePopper()
RAII class to pop scope from an expression context on destruction.
Expression function for use within a QgsExpressionContextScope.