QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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
 
QString addStoredExpression (const QString &name, const QString &expression, const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::FilterExpression)
 Adds an expression to the list.
 
void addStoredExpressions (const QList< QgsStoredExpression > &storedExpressions)
 Appends a list of expressions to the existing list.
 
void clearStoredExpressions ()
 Clears list of stored expressions.
 
QgsStoredExpression findStoredExpressionByExpression (const QString &expression, const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::All) const
 Returns an expression according to the expression text.
 
bool readXml (const QDomNode &layerNode)
 Reads the stored expressions in in XML format.
 
void removeStoredExpression (const QString &id)
 Removes an expression to the list.
 
QgsStoredExpression storedExpression (const QString &id) const
 Returns an expression according to the id.
 
QList< QgsStoredExpressionstoredExpressions (const QgsStoredExpression::Category &tag=QgsStoredExpression::Category::All)
 Returns the list of named expressions.
 
void updateStoredExpression (const QString &id, const QString &name, const QString &expression, const QgsStoredExpression::Category &tag)
 Updates an expression by id.
 
bool writeXml (QDomNode &layerNode) const
 Writes the stored expressions out in XML format.
 

Detailed Description

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

Since
QGIS 3.10

Definition at line 92 of file qgsstoredexpressionmanager.h.

Constructor & Destructor Documentation

◆ QgsStoredExpressionManager()

QgsStoredExpressionManager::QgsStoredExpressionManager ( )
default

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 25 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 68 of file qgsstoredexpressionmanager.cpp.

◆ clearStoredExpressions()

void QgsStoredExpressionManager::clearStoredExpressions ( )

Clears list of stored expressions.

Definition at line 111 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 99 of file qgsstoredexpressionmanager.cpp.

◆ readXml()

bool QgsStoredExpressionManager::readXml ( const QDomNode &  layerNode)

Reads the stored expressions in in XML format.

Definition at line 133 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 34 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 87 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 73 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 49 of file qgsstoredexpressionmanager.cpp.

◆ writeXml()

bool QgsStoredExpressionManager::writeXml ( QDomNode &  layerNode) const

Writes the stored expressions out in XML format.

Definition at line 116 of file qgsstoredexpressionmanager.cpp.


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