Class: QgsOptionalQgsExpressionBase

class qgis.core.QgsOptionalQgsExpressionBase

Bases: sip.wrapper

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)

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

Signals

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.