QGIS API Documentation 3.41.0-Master (af5edcb665c)
|
Manages stored expressions regarding creation, modification and storing in the project. More...
#include <qgsstoredexpressionmanager.h>
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< QgsStoredExpression > | storedExpressions (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. | |
Manages stored expressions regarding creation, modification and storing in the project.
Definition at line 92 of file qgsstoredexpressionmanager.h.
|
default |
QString QgsStoredExpressionManager::addStoredExpression | ( | const QString & | name, |
const QString & | expression, | ||
const QgsStoredExpression::Category & | tag = QgsStoredExpression::Category::FilterExpression |
||
) |
Adds an expression to the list.
name | optional name of the expression |
expression | expression text |
tag | category of the expression use case - default FilterExpression |
Definition at line 25 of file qgsstoredexpressionmanager.cpp.
void QgsStoredExpressionManager::addStoredExpressions | ( | const QList< QgsStoredExpression > & | storedExpressions | ) |
Appends a list of expressions to the existing list.
storedExpressions | list of expressions and the optional name |
Definition at line 68 of file qgsstoredexpressionmanager.cpp.
void QgsStoredExpressionManager::clearStoredExpressions | ( | ) |
Clears list of stored expressions.
Definition at line 111 of file qgsstoredexpressionmanager.cpp.
QgsStoredExpression QgsStoredExpressionManager::findStoredExpressionByExpression | ( | const QString & | expression, |
const QgsStoredExpression::Category & | tag = QgsStoredExpression::Category::All |
||
) | const |
Returns an expression according to the expression text.
expression | id of the expression as identification |
tag | category of the expression use case - default all |
Definition at line 99 of file qgsstoredexpressionmanager.cpp.
bool QgsStoredExpressionManager::readXml | ( | const QDomNode & | layerNode | ) |
Reads the stored expressions in in XML format.
Definition at line 133 of file qgsstoredexpressionmanager.cpp.
void QgsStoredExpressionManager::removeStoredExpression | ( | const QString & | id | ) |
Removes an expression to the list.
id | id of the expression as identification |
Definition at line 34 of file qgsstoredexpressionmanager.cpp.
QgsStoredExpression QgsStoredExpressionManager::storedExpression | ( | const QString & | id | ) | const |
Returns an expression according to the id.
id | id of the expression as identification |
Definition at line 87 of file qgsstoredexpressionmanager.cpp.
QList< QgsStoredExpression > QgsStoredExpressionManager::storedExpressions | ( | const QgsStoredExpression::Category & | tag = QgsStoredExpression::Category::All | ) |
Returns the list of named expressions.
tag | category of the expression use case - default all |
Definition at line 73 of file qgsstoredexpressionmanager.cpp.
void QgsStoredExpressionManager::updateStoredExpression | ( | const QString & | id, |
const QString & | name, | ||
const QString & | expression, | ||
const QgsStoredExpression::Category & | tag | ||
) |
Updates an expression by id.
id | id of the expression as identification |
name | new name of the expression |
expression | new expression text |
tag | new category of the expression use case |
Definition at line 49 of file qgsstoredexpressionmanager.cpp.
bool QgsStoredExpressionManager::writeXml | ( | QDomNode & | layerNode | ) | const |
Writes the stored expressions out in XML format.
Definition at line 116 of file qgsstoredexpressionmanager.cpp.