Subgroup: Optional

Class: QgsOptionalQgsExpressionBase

class qgis.core.QgsOptionalQgsExpressionBase

Bases: sip.wrapper

QgsOptional is a container for other classes and adds an additional enabled/disabled flag.

Often it is used for configuration options which can be enabled or disabled but also have more internal configuration information that should not be lost when disabling and re-enabling.

Note

For Python you need to use implementations for specific template classes

Note

Not available in Python bindings (although SIP file is present for specific implementations).

New in version 3.0: Methods

data Access the payload data
enabled Check if this optional is enabled
setData Set the payload data
setEnabled Set if this optional is enabled

Attributes

data(self) → QgsExpression

Access the payload data

New in version 3.0.

enabled(self) → bool

Check if this optional is enabled

New in version 3.0.

setData(self, data: QgsExpression)

Set the payload data

New in version 3.0.

setEnabled(self, enabled: bool)

Set if this optional is enabled

New in version 3.0.