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.

QgsOptionalQgsExpressionBase() A QgsOptional is disabled by default if default constructed.

QgsOptionalQgsExpressionBase(data: QgsExpression) A QgsOptional is enabled by default if constructed with payload.

QgsOptionalQgsExpressionBase(data: QgsExpression, enabled: bool) A QgsOptional constructed with enabled status and data

QgsOptionalQgsExpressionBase(QgsOptionalQgsExpressionBase)

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

data(self)QgsExpression

Access the payload data

New in version 3.0.

Return type

QgsExpression

enabled(self)bool

Check if this optional is enabled

New in version 3.0.

Return type

bool

setData(self, data: QgsExpression)

Set the payload data

New in version 3.0.

Parameters

data (QgsExpression) –

setEnabled(self, enabled: bool)

Set if this optional is enabled

New in version 3.0.

Parameters

enabled (bool) –