18 #ifndef QGSSTOREDEXPRESSIONMANAGER_H
19 #define QGSSTOREDEXPRESSIONMANAGER_H
21 #include "qgis_core.h"
51 FilterExpression = 1 << 0,
52 DefaultValueExpression = 1 << 1,
53 All = FilterExpression | DefaultValueExpression
71 : id( QUuid::createUuid().toString() ),
73 expression( expression ),
112 QString addStoredExpression(
const QString &name,
const QString &expression,
const QgsStoredExpression::Category &tag = QgsStoredExpression::Category::FilterExpression );
119 void removeStoredExpression(
const QString &
id );
136 void addStoredExpressions(
const QList< QgsStoredExpression > &storedExpressions );
162 void clearStoredExpressions();
165 bool writeXml( QDomNode &layerNode )
const;
168 bool readXml(
const QDomNode &layerNode );
175 QList< QgsStoredExpression > mStoredExpressions;
Manages stored expressions regarding creation, modification and storing in the project.
QgsStoredExpressionManager()=default
Constructor for QgsStoredExpressionManager.
Stored expression containing name, content (expression text) and a category tag.
QgsStoredExpression()=default
Constructor for QgsStoredExpression.
QString expression
expression text
Category
Categories of use cases FilterExpression for stored expressions to filter attribute table DefaultValu...
QgsStoredExpression(QString name, QString expression, Category tag=Category::FilterExpression)
Create a new QgsStoredExpression with a generated uuid as id.
QString id
generated uuid used for identification
Category tag
category of the expression use case
QString name
descriptive name of the expression