QGIS API Documentation  2.12.0-Lyon
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 ()
 
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 77 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 NULL if matching paint effect could not be created

Definition at line 86 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 NULL if matching paint effect could not be created

Definition at line 95 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 123 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 NULL

Definition at line 69 of file qgspainteffectregistry.cpp.

QStringList QgsPaintEffectRegistry::effects ( ) const

Returns a list of known paint effects.

Returns
list of paint effect names

Definition at line 112 of file qgspainteffectregistry.cpp.

QgsPaintEffectRegistry * QgsPaintEffectRegistry::instance ( )
static

Definition at line 63 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 143 of file qgspainteffectregistry.cpp.

Member Data Documentation

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

Definition at line 212 of file qgspainteffectregistry.h.


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