QGIS API Documentation  2.17.0-Master (f49f7ce)
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsRendererV2Registry Class Reference

Registry of renderers. More...

#include <qgsrendererv2registry.h>

Public Member Functions

bool addRenderer (QgsRendererV2AbstractMetadata *metadata)
 Adds a renderer to the registry. More...
 
bool removeRenderer (const QString &rendererName)
 Removes a renderer from registry. More...
 
QgsRendererV2AbstractMetadatarendererMetadata (const QString &rendererName)
 Returns the metadata for a specified renderer. More...
 
QStringList renderersList (QgsRendererV2AbstractMetadata::LayerTypes layerTypes=QgsRendererV2AbstractMetadata::All) const
 Returns a list of available renderers. More...
 
QStringList renderersList (const QgsVectorLayer *layer) const
 Returns a list of available renderers which are compatible with a specified layer. More...
 

Static Public Member Functions

static QgsRendererV2Registryinstance ()
 Returns a pointer to the QgsRendererV2Registry singleton. More...
 

Protected Member Functions

 QgsRendererV2Registry ()
 protected constructor More...
 
 ~QgsRendererV2Registry ()
 

Protected Attributes

QMap< QString, QgsRendererV2AbstractMetadata * > mRenderers
 Map of name to renderer. More...
 
QStringList mRenderersOrder
 List of renderers, maintained in the order that they have been added. More...
 

Detailed Description

Registry of renderers.

This is a singleton, renderers can be added / removed at any time

Definition at line 180 of file qgsrendererv2registry.h.

Constructor & Destructor Documentation

QgsRendererV2Registry::QgsRendererV2Registry ( )
protected

protected constructor

Definition at line 29 of file qgsrendererv2registry.cpp.

QgsRendererV2Registry::~QgsRendererV2Registry ( )
protected

Definition at line 84 of file qgsrendererv2registry.cpp.

Member Function Documentation

bool QgsRendererV2Registry::addRenderer ( QgsRendererV2AbstractMetadata metadata)

Adds a renderer to the registry.

Takes ownership of the metadata object.

Parameters
metadatarenderer metadata
Returns
true if renderer was added successfully, or false if renderer could not be added (eg a renderer with a duplicate name already exists)

Definition at line 96 of file qgsrendererv2registry.cpp.

QgsRendererV2Registry * QgsRendererV2Registry::instance ( )
static

Returns a pointer to the QgsRendererV2Registry singleton.

Definition at line 89 of file qgsrendererv2registry.cpp.

bool QgsRendererV2Registry::removeRenderer ( const QString rendererName)

Removes a renderer from registry.

Parameters
rendererNamename of renderer to remove from registry
Returns
true if renderer was sucessfully removed, or false if matching renderer could not be found

Definition at line 106 of file qgsrendererv2registry.cpp.

QgsRendererV2AbstractMetadata * QgsRendererV2Registry::rendererMetadata ( const QString rendererName)

Returns the metadata for a specified renderer.

Returns NULL if a matching renderer was not found in the registry.

Definition at line 117 of file qgsrendererv2registry.cpp.

QStringList QgsRendererV2Registry::renderersList ( QgsRendererV2AbstractMetadata::LayerTypes  layerTypes = QgsRendererV2AbstractMetadata::All) const

Returns a list of available renderers.

Parameters
layerTypesflags to filter the renderers by compatible layer types

Definition at line 124 of file qgsrendererv2registry.cpp.

QStringList QgsRendererV2Registry::renderersList ( const QgsVectorLayer layer) const

Returns a list of available renderers which are compatible with a specified layer.

Parameters
layervector layer
Note
added in QGIS 2.16

Definition at line 135 of file qgsrendererv2registry.cpp.

Member Data Documentation

QMap<QString, QgsRendererV2AbstractMetadata*> QgsRendererV2Registry::mRenderers
protected

Map of name to renderer.

Definition at line 218 of file qgsrendererv2registry.h.

QStringList QgsRendererV2Registry::mRenderersOrder
protected

List of renderers, maintained in the order that they have been added.

Definition at line 221 of file qgsrendererv2registry.h.


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