QGIS API Documentation  3.6.0-Noosa (5873452)
Public Member Functions | Static Public Member Functions | List of all members
QgsPaintEffectRegistry Class Reference

Registry of available paint effects. More...

#include <qgspainteffectregistry.h>

Public Member Functions

 QgsPaintEffectRegistry ()
 
 QgsPaintEffectRegistry (const QgsPaintEffectRegistry &rh)=delete
 QgsPaintEffectRegistry cannot be copied. More...
 
 ~QgsPaintEffectRegistry ()
 
bool addEffectType (QgsPaintEffectAbstractMetadata *metadata)
 Registers a new effect type. More...
 
QgsPaintEffectcreateEffect (const QString &name, const QgsStringMap &properties=QgsStringMap()) const
 Creates a new paint effect given the effect name and properties map. More...
 
QgsPaintEffectcreateEffect (const QDomElement &element) const
 Creates a new paint effect given a DOM element storing paint effect properties. More...
 
QgsPaintEffectAbstractMetadataeffectMetadata (const QString &name) const
 Returns the metadata for a specific effect. More...
 
QStringList effects () const
 Returns a list of known paint effects. More...
 
QgsPaintEffectRegistryoperator= (const QgsPaintEffectRegistry &rh)=delete
 QgsPaintEffectRegistry cannot be copied. More...
 

Static Public Member Functions

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

Detailed Description

Registry of available paint effects.

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

Since
QGIS 2.9

Definition at line 174 of file qgspainteffectregistry.h.

Constructor & Destructor Documentation

◆ QgsPaintEffectRegistry() [1/2]

QgsPaintEffectRegistry::QgsPaintEffectRegistry ( )

Definition at line 32 of file qgspainteffectregistry.cpp.

◆ ~QgsPaintEffectRegistry()

QgsPaintEffectRegistry::~QgsPaintEffectRegistry ( )

Definition at line 55 of file qgspainteffectregistry.cpp.

◆ QgsPaintEffectRegistry() [2/2]

QgsPaintEffectRegistry::QgsPaintEffectRegistry ( const QgsPaintEffectRegistry rh)
delete

QgsPaintEffectRegistry cannot be copied.

Member Function Documentation

◆ addEffectType()

bool QgsPaintEffectRegistry::addEffectType ( QgsPaintEffectAbstractMetadata metadata)

Registers a new effect type.

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

Definition at line 68 of file qgspainteffectregistry.cpp.

◆ createEffect() [1/2]

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

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

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

Definition at line 77 of file qgspainteffectregistry.cpp.

◆ createEffect() [2/2]

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

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

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

Definition at line 86 of file qgspainteffectregistry.cpp.

◆ defaultStack()

QgsPaintEffect * QgsPaintEffectRegistry::defaultStack ( )
static

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.

Returns
default effects stack
See also
isDefaultStack()

Definition at line 114 of file qgspainteffectregistry.cpp.

◆ effectMetadata()

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

Returns the metadata for a specific effect.

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

Definition at line 60 of file qgspainteffectregistry.cpp.

◆ effects()

QStringList QgsPaintEffectRegistry::effects ( ) const

Returns a list of known paint effects.

Returns
list of paint effect names

Definition at line 103 of file qgspainteffectregistry.cpp.

◆ isDefaultStack()

bool QgsPaintEffectRegistry::isDefaultStack ( QgsPaintEffect effect)
static

Tests whether a paint effect matches the default effects stack.

Parameters
effectpaint effect to test
Returns
true if effect is default stack
See also
defaultStack()
Since
QGIS 2.12

Definition at line 134 of file qgspainteffectregistry.cpp.

◆ operator=()

QgsPaintEffectRegistry& QgsPaintEffectRegistry::operator= ( const QgsPaintEffectRegistry rh)
delete

QgsPaintEffectRegistry cannot be copied.


The documentation for this class was generated from the following files: