QGIS API Documentation  3.24.2-Tisler (13c1a02865)
Public Member Functions | List of all members
QgsRendererRegistry Class Reference

Registry of renderers. More...

#include <qgsrendererregistry.h>

Public Member Functions

 QgsRendererRegistry ()
 
 QgsRendererRegistry (const QgsRendererRegistry &rh)=delete
 QgsRendererRegistry cannot be copied. More...
 
 ~QgsRendererRegistry ()
 
bool addRenderer (QgsRendererAbstractMetadata *metadata)
 Adds a renderer to the registry. More...
 
QgsRendererRegistryoperator= (const QgsRendererRegistry &rh)=delete
 QgsRendererRegistry cannot be copied. More...
 
bool removeRenderer (const QString &rendererName)
 Removes a renderer from registry. More...
 
QgsRendererAbstractMetadatarendererMetadata (const QString &rendererName)
 Returns the metadata for a specified renderer. More...
 
QStringList renderersList (const QgsVectorLayer *layer) const
 Returns a list of available renderers which are compatible with a specified layer. More...
 
QStringList renderersList (QgsRendererAbstractMetadata::LayerTypes layerTypes=QgsRendererAbstractMetadata::All) const
 Returns a list of available renderers. More...
 

Detailed Description

Registry of renderers.

QgsRendererRegistry is not usually directly created, but rather accessed through QgsApplication::rendererRegistry().

Definition at line 224 of file qgsrendererregistry.h.

Constructor & Destructor Documentation

◆ QgsRendererRegistry() [1/2]

QgsRendererRegistry::QgsRendererRegistry ( )

Definition at line 33 of file qgsrendererregistry.cpp.

◆ ~QgsRendererRegistry()

QgsRendererRegistry::~QgsRendererRegistry ( )

Definition at line 106 of file qgsrendererregistry.cpp.

◆ QgsRendererRegistry() [2/2]

QgsRendererRegistry::QgsRendererRegistry ( const QgsRendererRegistry rh)
delete

QgsRendererRegistry cannot be copied.

Member Function Documentation

◆ addRenderer()

bool QgsRendererRegistry::addRenderer ( QgsRendererAbstractMetadata 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 (e.g., a renderer with a duplicate name already exists)

Definition at line 111 of file qgsrendererregistry.cpp.

◆ operator=()

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

QgsRendererRegistry cannot be copied.

◆ removeRenderer()

bool QgsRendererRegistry::removeRenderer ( const QString &  rendererName)

Removes a renderer from registry.

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

Definition at line 121 of file qgsrendererregistry.cpp.

◆ rendererMetadata()

QgsRendererAbstractMetadata * QgsRendererRegistry::rendererMetadata ( const QString &  rendererName)

Returns the metadata for a specified renderer.

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

Definition at line 132 of file qgsrendererregistry.cpp.

◆ renderersList() [1/2]

QStringList QgsRendererRegistry::renderersList ( const QgsVectorLayer layer) const

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

Parameters
layervector layer
Since
QGIS 2.16

Definition at line 150 of file qgsrendererregistry.cpp.

◆ renderersList() [2/2]

QStringList QgsRendererRegistry::renderersList ( QgsRendererAbstractMetadata::LayerTypes  layerTypes = QgsRendererAbstractMetadata::All) const

Returns a list of available renderers.

Parameters
layerTypesflags to filter the renderers by compatible layer types

Definition at line 137 of file qgsrendererregistry.cpp.


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