QgsMapLayerStyleOverride class

Restore overridden layer style on destruction.

Constructors, destructors, conversion operators

QgsMapLayerStyleOverride(QgsMapLayer* layer)
Construct a style override object associated with a map layer.

Public functions

void setOverrideStyle(const QString& style)
Temporarily apply a different style to the layer.

Function documentation

QgsMapLayerStyleOverride::QgsMapLayerStyleOverride(QgsMapLayer* layer)

Construct a style override object associated with a map layer.

The overridden style will be restored upon object destruction.

void QgsMapLayerStyleOverride::setOverrideStyle(const QString& style)

Temporarily apply a different style to the layer.

The argument can be either a style name or a full QML style definition.