QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
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.
Class for parsing and evaluation of expressions (formerly called "search strings").