QgsPaintEffectRegistry class

Registry of available paint effects.

QgsPaintEffectRegistry is not usually directly created, but rather accessed through QgsApplication::paintEffectRegistry().

Public static functions

static auto defaultStack() -> QgsPaintEffect*
Returns a new effect stack consisting of a sensible selection of default effects.
static auto isDefaultStack(QgsPaintEffect* effect) -> bool
Tests whether a paint effect matches the default effects stack.

Constructors, destructors, conversion operators

QgsPaintEffectRegistry(const QgsPaintEffectRegistry& rh) deleted
QgsPaintEffectRegistry cannot be copied.

Public functions

auto addEffectType(QgsPaintEffectAbstractMetadata* metadata) -> bool
Registers a new effect type.
auto createEffect(const QString& name, const QgsStringMap& properties = QgsStringMap()) const -> QgsPaintEffect*
Creates a new paint effect given the effect name and properties map.
auto createEffect(const QDomElement& element) const -> QgsPaintEffect*
Creates a new paint effect given a DOM element storing paint effect properties.
auto effectMetadata(const QString& name) const -> QgsPaintEffectAbstractMetadata*
Returns the metadata for a specific effect.
auto effects() const -> QStringList
Returns a list of known paint effects.
auto operator=(const QgsPaintEffectRegistry& rh) -> QgsPaintEffectRegistry& deleted
QgsPaintEffectRegistry cannot be copied.

Function documentation

static QgsPaintEffect* QgsPaintEffectRegistry::defaultStack()

Returns a new effect stack consisting of a sensible selection of default effects.

Returns default effects stack

All effects except the standard draw source effect are disabled, but are included so that they can be easily drawn just by enabling the effect.

static bool QgsPaintEffectRegistry::isDefaultStack(QgsPaintEffect* effect)

Tests whether a paint effect matches the default effects stack.

Parameters
effect paint effect to test
Returns true if effect is default stack

bool QgsPaintEffectRegistry::addEffectType(QgsPaintEffectAbstractMetadata* metadata)

Registers a new effect type.

Parameters
metadata effect metadata. Ownership is transferred to the registry.
Returns true if add was successful.

QgsPaintEffect* QgsPaintEffectRegistry::createEffect(const QString& name, const QgsStringMap& properties = QgsStringMap()) const

Creates a new paint effect given the effect name and properties map.

Parameters
name unique name representing paint effect class
properties encoded string map of effect properties
Returns new paint effect of specified class, or nullptr if matching paint effect could not be created

QgsPaintEffect* QgsPaintEffectRegistry::createEffect(const QDomElement& element) const

Creates a new paint effect given a DOM element storing paint effect properties.

Parameters
element encoded DOM element of effect properties
Returns new paint effect, or nullptr if matching paint effect could not be created

QgsPaintEffectAbstractMetadata* QgsPaintEffectRegistry::effectMetadata(const QString& name) const

Returns the metadata for a specific effect.

Parameters
name unique string name for paint effect class
Returns paint effect metadata if found, otherwise nullptr

QStringList QgsPaintEffectRegistry::effects() const

Returns a list of known paint effects.

Returns list of paint effect names