QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
33 QDomText exp = element.ownerDocument().createTextNode(
data().expression() );
34 element.setAttribute( QStringLiteral(
"enabled" ),
enabled() );
35 element.appendChild( exp );
40 setEnabled( element.attribute( QStringLiteral(
"enabled" ) ).toInt() );
QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
bool enabled() const
Check if this optional is enabled.
void writeXml(QDomElement &element)
Save the optional expression to the provided QDomElement.
QgsOptionalExpression()=default
Construct a default optional expression.
void readXml(const QDomElement &element)
Read the optional expression from the provided QDomElement.
void setData(const QgsExpression &data)
Set the payload data.
void setEnabled(bool enabled)
Set if this optional is enabled.
QgsExpression data() const
Access the payload data.