Subgroup: Optional
Class: QgsOptionalExpression¶
-
class
qgis.core.
QgsOptionalExpression
¶ Bases:
qgis._core.QgsOptionalQgsExpressionBase
An expression with an additional enabled flag.
This can be used for configuration options where an expression can be enabled or disabled but when disabled it shouldn’t lose it’s information for the case it gets re-enabled later on and a user shouldn’t be force to redo the configuration.
New in version 2.18: Methods
data
Access the payload data enabled
Check if this optional is enabled readXml
Read the optional expression from the provided QDomElement. setData
Set the payload data setEnabled
Set if this optional is enabled writeXml
Save the optional expression to the provided QDomElement. Attributes
-
readXml
(self, element: QDomElement)¶ Read the optional expression from the provided QDomElement.
New in version 2.18.
-
writeXml
(self, element: QDomElement)¶ Save the optional expression to the provided QDomElement.
The caller is responsible to pass an empty QDomElement and to append it to a parent element.
New in version 2.18.
-