Class: QgsPaintEffectRegistry¶
- class qgis.core.QgsPaintEffectRegistry¶
Bases:
sip.wrapper
Registry of available paint effects.
QgsPaintEffectRegistry
is not usually directly created, but rather accessed throughQgsApplication.paintEffectRegistry()
.Methods
Registers a new effect type.
Creates a new paint effect given the effect name and properties map.
Returns a new effect stack consisting of a sensible selection of default effects.
Returns the metadata for a specific effect.
Returns a list of known paint effects.
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, Any] = {}) → 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
- 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
- Returns
default effects stack
See also
- effectMetadata(self, name: str) → QgsPaintEffectAbstractMetadata¶
Returns the metadata for a specific effect.
- Parameters
name (str) – unique string name for paint effect class
- Return type
- 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
New in version 2.12.