Class: QgsPaintEffectRegistry

class qgis.core.QgsPaintEffectRegistry

Bases: sip.wrapper

Registry of available paint effects.

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

Methods

addEffectType

Registers a new effect type.

createEffect

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

defaultStack

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

effectMetadata

Returns the metadata for a specific effect.

effects

Returns a list of known paint effects.

isDefaultStack

Tests whether a paint effect matches the default effects stack.

addEffectType(self, metadata: QgsPaintEffectAbstractMetadata) → bool

Registers a new effect type.

Parameters

metadata (QgsPaintEffectAbstractMetadata) – effect metadata. Ownership is transferred to the registry.

Return type

bool

Returns

True if add was successful.

createEffect(self, name: str, properties: Dict[str, str] = {}) → QgsPaintEffect

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

Parameters
  • name (str) – unique name representing paint effect class

  • properties (Dict[str) – encoded string map of effect properties

Returns

new paint effect of specified class, or None if matching paint effect could not be created

createEffect(self, element: QDomElement) -> QgsPaintEffect Creates a new paint effect given a DOM element storing paint effect properties.

Parameters

element – encoded DOM element of effect properties

Return type

QgsPaintEffect

Returns

new paint effect, or None if matching paint effect could not be created

defaultStack() → QgsPaintEffect

Returns a new effect stack consisting of a sensible selection of default effects. 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.

Return type

QgsPaintEffect

Returns

default effects stack

See also

isDefaultStack()

effectMetadata(self, name: str) → QgsPaintEffectAbstractMetadata

Returns the metadata for a specific effect.

Parameters

name (str) – unique string name for paint effect class

Return type

QgsPaintEffectAbstractMetadata

Returns

paint effect metadata if found, otherwise None

effects(self) → List[str]

Returns a list of known paint effects.

Return type

List[str]

Returns

list of paint effect names

isDefaultStack(effect: QgsPaintEffect) → bool

Tests whether a paint effect matches the default effects stack.

Parameters

effect (QgsPaintEffect) – paint effect to test

Return type

bool

Returns

True if effect is default stack

See also

defaultStack()

New in version 2.12.