QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
Public Member Functions | List of all members
QgsStoredExpressionManager Class Reference

Manages stored expressions regarding creation, modification and storing in the project. More...

#include <qgsstoredexpressionmanager.h>

Inheritance diagram for QgsStoredExpressionManager:
Inheritance graph
[legend]

Public Member Functions

 QgsStoredExpressionManager ()=default
 Constructor for QgsStoredExpressionManager. More...
 
QString addStoredExpression (const QString &name, const QString &expression, const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::FilterExpression)
 Adds an expression to the list. More...
 
void addStoredExpressions (const QList< QgsStoredExpression > &storedExpressions)
 Appends a list of expressions to the existing list. More...
 
void clearStoredExpressions ()
 Clears list of stored expressions. More...
 
QgsStoredExpression findStoredExpressionByExpression (const QString &expression, const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::All) const
 Returns an expression according to the expression text. More...
 
bool readXml (const QDomNode &layerNode)
 Reads the stored expressions in in XML format. More...
 
void removeStoredExpression (const QString &id)
 Removes an expression to the list. More...
 
QgsStoredExpression storedExpression (const QString &id) const
 Returns an expression according to the id. More...
 
QList< QgsStoredExpressionstoredExpressions (const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::All)
 Returns the list of named expressions. More...
 
void updateStoredExpression (const QString &id, const QString &name, const QString &expression, const QgsStoredExpression::Category &tag)
 Updates an expression by id. More...
 
bool writeXml (QDomNode &layerNode) const
 Writes the stored expressions out in XML format. More...
 

Detailed Description

Manages stored expressions regarding creation, modification and storing in the project.

Since
QGIS 3.10

Definition at line 95 of file qgsstoredexpressionmanager.h.

Constructor & Destructor Documentation

◆ QgsStoredExpressionManager()

QgsStoredExpressionManager::QgsStoredExpressionManager ( )
default

Constructor for QgsStoredExpressionManager.

Member Function Documentation

◆ addStoredExpression()

QString QgsStoredExpressionManager::addStoredExpression ( const QString &  name,
const QString &  expression,
const QgsStoredExpression::Category tag = QgsStoredExpression::Category::FilterExpression 
)

Adds an expression to the list.

Parameters
nameoptional name of the expression
expressionexpression text
tagcategory of the expression use case - default FilterExpression
Returns
generated id

Definition at line 24 of file qgsstoredexpressionmanager.cpp.

◆ addStoredExpressions()

void QgsStoredExpressionManager::addStoredExpressions ( const QList< QgsStoredExpression > &  storedExpressions)

Appends a list of expressions to the existing list.

Parameters
storedExpressionslist of expressions and the optional name

Definition at line 67 of file qgsstoredexpressionmanager.cpp.

◆ clearStoredExpressions()

void QgsStoredExpressionManager::clearStoredExpressions ( )

Clears list of stored expressions.

Definition at line 110 of file qgsstoredexpressionmanager.cpp.

◆ findStoredExpressionByExpression()

QgsStoredExpression QgsStoredExpressionManager::findStoredExpressionByExpression ( const QString &  expression,
const QgsStoredExpression::Category tag = QgsStoredExpression::Category::All 
) const

Returns an expression according to the expression text.

Parameters
expressionid of the expression as identification
tagcategory of the expression use case - default all

Definition at line 98 of file qgsstoredexpressionmanager.cpp.

◆ readXml()

bool QgsStoredExpressionManager::readXml ( const QDomNode &  layerNode)

Reads the stored expressions in in XML format.

Definition at line 132 of file qgsstoredexpressionmanager.cpp.

◆ removeStoredExpression()

void QgsStoredExpressionManager::removeStoredExpression ( const QString &  id)

Removes an expression to the list.

Parameters
idid of the expression as identification

Definition at line 33 of file qgsstoredexpressionmanager.cpp.

◆ storedExpression()

QgsStoredExpression QgsStoredExpressionManager::storedExpression ( const QString &  id) const

Returns an expression according to the id.

Parameters
idid of the expression as identification

Definition at line 86 of file qgsstoredexpressionmanager.cpp.

◆ storedExpressions()

QList< QgsStoredExpression > QgsStoredExpressionManager::storedExpressions ( const QgsStoredExpression::Category tag = QgsStoredExpression::Category::All)

Returns the list of named expressions.

Parameters
tagcategory of the expression use case - default all

Definition at line 72 of file qgsstoredexpressionmanager.cpp.

◆ updateStoredExpression()

void QgsStoredExpressionManager::updateStoredExpression ( const QString &  id,
const QString &  name,
const QString &  expression,
const QgsStoredExpression::Category tag 
)

Updates an expression by id.

Parameters
idid of the expression as identification
namenew name of the expression
expressionnew expression text
tagnew category of the expression use case

Definition at line 48 of file qgsstoredexpressionmanager.cpp.

◆ writeXml()

bool QgsStoredExpressionManager::writeXml ( QDomNode &  layerNode) const

Writes the stored expressions out in XML format.

Definition at line 115 of file qgsstoredexpressionmanager.cpp.


The documentation for this class was generated from the following files: