QGIS API Documentation  2.18.3-Las Palmas (77b8c3d)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsPaintEffectRegistry Class Reference

Singleton registry of available paint effects. More...

#include <qgspainteffectregistry.h>

Public Member Functions

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...
 

Static Public Member Functions

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

Protected Member Functions

 QgsPaintEffectRegistry ()
 
 ~QgsPaintEffectRegistry ()
 

Protected Attributes

QMap< QString, QgsPaintEffectAbstractMetadata * > mMetadata
 

Detailed Description

Singleton registry of available paint effects.

Note
Added in version 2.9

Definition at line 154 of file qgspainteffectregistry.h.

Constructor & Destructor Documentation

QgsPaintEffectRegistry::QgsPaintEffectRegistry ( )
protected

Definition at line 31 of file qgspainteffectregistry.cpp.

QgsPaintEffectRegistry::~QgsPaintEffectRegistry ( )
protected

Definition at line 54 of file qgspainteffectregistry.cpp.

Member Function Documentation

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 73 of file qgspainteffectregistry.cpp.

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 82 of file qgspainteffectregistry.cpp.

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 91 of file qgspainteffectregistry.cpp.

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 119 of file qgspainteffectregistry.cpp.

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 65 of file qgspainteffectregistry.cpp.

QStringList QgsPaintEffectRegistry::effects ( ) const

Returns a list of known paint effects.

Returns
list of paint effect names

Definition at line 108 of file qgspainteffectregistry.cpp.

QgsPaintEffectRegistry * QgsPaintEffectRegistry::instance ( )
static

Returns a reference to the singleton instance of the paint effect registry.

Definition at line 59 of file qgspainteffectregistry.cpp.

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
Note
added in QGIS 2.12
See also
defaultStack()

Definition at line 139 of file qgspainteffectregistry.cpp.

Member Data Documentation

QMap<QString, QgsPaintEffectAbstractMetadata*> QgsPaintEffectRegistry::mMetadata
protected

Definition at line 215 of file qgspainteffectregistry.h.


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