Class: QgsStoredExpressionManager

class qgis.core.QgsStoredExpressionManager

Bases: PyQt5.QtCore.QObject

Constructor for QgsStoredExpressionManager

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

Methods

addStoredExpression

Adds an expression to the list

addStoredExpressions

Appends a list of expressions to the existing list

childEvent

clearStoredExpressions

Clears list of stored expressions

connectNotify

customEvent

disconnectNotify

findStoredExpressionByExpression

Returns an expression according to the expression text

isSignalConnected

readXml

Reads the stored expressions in in XML format

receivers

removeStoredExpression

Removes an expression to the list

sender

senderSignalIndex

storedExpression

Returns an expression according to the id

storedExpressions

Returns the list of named expressions

timerEvent

updateStoredExpression

Updates an expression by id.

writeXml

Writes the stored expressions out in XML format

addStoredExpression(self, name: str, expression: str, tag: QgsStoredExpression.Category = QgsStoredExpression.Category.FilterExpression) → str

Adds an expression to the list

Parameters
  • name (str) – optional name of the expression

  • expression (str) – expression text

  • tag (QgsStoredExpression.Category = QgsStoredExpression.Category.FilterExpression) – category of the expression use case - default FilterExpression

Return type

str

Returns

generated id

addStoredExpressions(self, storedExpressions: Iterable[QgsStoredExpression])

Appends a list of expressions to the existing list

Parameters

storedExpressions (Iterable[QgsStoredExpression]) – list of expressions and the optional name

childEvent()
clearStoredExpressions(self)

Clears list of stored expressions

connectNotify()
customEvent()
disconnectNotify()
findStoredExpressionByExpression(self, expression: str, tag: QgsStoredExpression.Category = QgsStoredExpression.Category.All) → QgsStoredExpression

Returns an expression according to the expression text

Parameters
  • expression (str) – id of the expression as identification

  • tag (QgsStoredExpression.Category = QgsStoredExpression.Category.All) – category of the expression use case - default all

Return type

QgsStoredExpression

isSignalConnected()
readXml(self, layerNode: QDomNode) → bool

Reads the stored expressions in in XML format

Parameters

layerNode (QDomNode) –

Return type

bool

receivers()
removeStoredExpression(self, id: str)

Removes an expression to the list

Parameters

id (str) – id of the expression as identification

sender()
senderSignalIndex()
storedExpression(self, id: str) → QgsStoredExpression

Returns an expression according to the id

Parameters

id (str) – id of the expression as identification

Return type

QgsStoredExpression

storedExpressions(self, tag: QgsStoredExpression.Category = QgsStoredExpression.Category.All) → List[QgsStoredExpression]

Returns the list of named expressions

Parameters

tag (QgsStoredExpression.Category = QgsStoredExpression.Category.All) – category of the expression use case - default all

Return type

List[QgsStoredExpression]

timerEvent()
updateStoredExpression(self, id: str, name: str, expression: str, tag: QgsStoredExpression.Category)

Updates an expression by id.

Parameters
  • id (str) – id of the expression as identification

  • name (str) – new name of the expression

  • expression (str) – new expression text

  • tag (QgsStoredExpression.Category) – new category of the expression use case

writeXml(self, layerNode: QDomNode) → bool

Writes the stored expressions out in XML format

Parameters

layerNode (QDomNode) –

Return type

bool