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 readXml(const QDomElement &element)
Read the optional expression from the provided QDomElement.
void setData(const QgsExpression &data)
Set the payload data.
QgsOptionalExpression()=default
Construct a default optional expression.
void writeXml(QDomElement &element)
Save the optional expression to the provided QDomElement.
bool enabled() const
Check if this optional is enabled.
QgsOptional is a container for other classes and adds an additional enabled/disabled flag...
QgsExpression data() const
Access the payload data.
void setEnabled(bool enabled)
Set if this optional is enabled.