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() );
Class for parsing and evaluation of expressions (formerly called "search strings").
void writeXml(QDomElement &element)
Save the optional expression to the provided QDomElement.
void readXml(const QDomElement &element)
Read the optional expression from the provided QDomElement.
QgsOptionalExpression()=default
Construct a default optional expression.
QgsOptional is a container for other classes and adds an additional enabled/disabled flag.
bool enabled() const
Check if this optional is enabled.
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.