Class: QgsPaintEffectRegistry¶
Registry of available paint effects.
QgsPaintEffectRegistry
is not usually directly created, but
rather accessed through QgsApplication.paintEffectRegistry()
.
Methods
Registers a new effect type. |
|
Creates a new paint effect given the effect name and properties map. |
|
Returns the metadata for a specific effect. |
|
Returns a list of known paint effects. |
Static Methods
Returns a new effect stack consisting of a sensible selection of default effects. |
|
Tests whether a paint effect matches the default effects stack. |
- class qgis.core.QgsPaintEffectRegistry[source]¶
Bases:
object
- addEffectType(self, metadata: QgsPaintEffectAbstractMetadata | None) bool [source]¶
Registers a new effect type.
- Parameters:
metadata (Optional[QgsPaintEffectAbstractMetadata]) – effect metadata. Ownership is transferred to the registry.
- Return type:
bool
- Returns:
True
if add was successful.
- createEffect(self, name: str | None, properties: Dict[str, Any] = {}) QgsPaintEffect | None [source]¶
Creates a new paint effect given the effect name and properties map.
- Parameters:
name (Optional[str]) – unique name representing paint effect class
properties (Dict[str, Any] = {}) – encoded string map of effect properties
- Return type:
Optional[QgsPaintEffect]
- Returns:
new paint effect of specified class, or
None
if matching paint effect could not be created
- createEffect(self, element: QDomElement) QgsPaintEffect | None [source]
Creates a new paint effect given a DOM element storing paint effect properties.
- Parameters:
element (QDomElement) – encoded DOM element of effect properties
- Return type:
Optional[QgsPaintEffect]
- Returns:
new paint effect, or
None
if matching paint effect could not be created
- static defaultStack() QgsPaintEffect | None [source]¶
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:
Optional[QgsPaintEffect]
- Returns:
default effects stack
See also
- effectMetadata(self, name: str | None) QgsPaintEffectAbstractMetadata | None [source]¶
Returns the metadata for a specific effect.
- Parameters:
name (Optional[str]) – unique string name for paint effect class
- Return type:
Optional[QgsPaintEffectAbstractMetadata]
- Returns:
paint effect metadata if found, otherwise
None
- effects(self) List[str] [source]¶
Returns a list of known paint effects.
- Return type:
List[str]
- Returns:
list of paint effect names
- static isDefaultStack(effect: QgsPaintEffect | None) bool [source]¶
Tests whether a paint effect matches the default effects stack.
- Parameters:
effect (Optional[QgsPaintEffect]) – paint effect to test
- Return type:
bool
- Returns:
True
if effect is default stack
See also