QGIS API Documentation 3.99.0-Master (09f76ad7019)
Loading...
Searching...
No Matches
QgsSymbolLayerRegistry Class Reference

Registry of available symbol layer classes. More...

#include <qgssymbollayerregistry.h>

Public Member Functions

 QgsSymbolLayerRegistry ()
 QgsSymbolLayerRegistry (const QgsSymbolLayerRegistry &rh)=delete
 ~QgsSymbolLayerRegistry ()
bool addSymbolLayerType (QgsSymbolLayerAbstractMetadata *metadata)
 Registers a new symbol layer type. Takes ownership of the metadata instance.
std::unique_ptr< QgsSymbolLayercreateSymbolLayer (const QString &name, const QVariantMap &properties=QVariantMap()) const
 create a new instance of symbol layer given symbol layer name and properties
std::unique_ptr< QgsSymbolLayercreateSymbolLayerFromSld (const QString &name, QDomElement &element) const
 create a new instance of symbol layer given symbol layer name and SLD
QgsSymbolLayerRegistryoperator= (const QgsSymbolLayerRegistry &rh)=delete
bool removeSymbolLayerType (QgsSymbolLayerAbstractMetadata *metadata)
 Removes a symbol layer type.
void resolveFonts (const QString &name, QVariantMap &properties, const QgsReadWriteContext &context) const
 Resolve fonts from the properties of a particular symbol layer.
void resolvePaths (const QString &name, QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving) const
 Resolve paths in properties of a particular symbol layer.
QgsSymbolLayerAbstractMetadatasymbolLayerMetadata (const QString &name) const
 Returns metadata for specified symbol layer. Returns nullptr if not found.
QStringList symbolLayersForType (Qgis::SymbolType type)
 Returns a list of available symbol layers for a specified symbol type.

Static Public Member Functions

static std::unique_ptr< QgsSymbolLayerdefaultSymbolLayer (Qgis::SymbolType type)
 create a new instance of symbol layer for specified symbol type with default settings

Detailed Description

Registry of available symbol layer classes.

QgsSymbolLayerRegistry is not usually directly created, but rather accessed through QgsApplication::symbolLayerRegistry().

Definition at line 182 of file qgssymbollayerregistry.h.

Constructor & Destructor Documentation

◆ QgsSymbolLayerRegistry() [1/2]

QgsSymbolLayerRegistry::QgsSymbolLayerRegistry ( )

Definition at line 33 of file qgssymbollayerregistry.cpp.

◆ ~QgsSymbolLayerRegistry()

QgsSymbolLayerRegistry::~QgsSymbolLayerRegistry ( )

Definition at line 97 of file qgssymbollayerregistry.cpp.

◆ QgsSymbolLayerRegistry() [2/2]

QgsSymbolLayerRegistry::QgsSymbolLayerRegistry ( const QgsSymbolLayerRegistry & rh)
delete

Member Function Documentation

◆ addSymbolLayerType()

bool QgsSymbolLayerRegistry::addSymbolLayerType ( QgsSymbolLayerAbstractMetadata * metadata)

Registers a new symbol layer type. Takes ownership of the metadata instance.

Definition at line 102 of file qgssymbollayerregistry.cpp.

◆ createSymbolLayer()

std::unique_ptr< QgsSymbolLayer > QgsSymbolLayerRegistry::createSymbolLayer ( const QString & name,
const QVariantMap & properties = QVariantMap() ) const

create a new instance of symbol layer given symbol layer name and properties

Definition at line 147 of file qgssymbollayerregistry.cpp.

◆ createSymbolLayerFromSld()

std::unique_ptr< QgsSymbolLayer > QgsSymbolLayerRegistry::createSymbolLayerFromSld ( const QString & name,
QDomElement & element ) const

create a new instance of symbol layer given symbol layer name and SLD

Definition at line 155 of file qgssymbollayerregistry.cpp.

◆ defaultSymbolLayer()

std::unique_ptr< QgsSymbolLayer > QgsSymbolLayerRegistry::defaultSymbolLayer ( Qgis::SymbolType type)
static

create a new instance of symbol layer for specified symbol type with default settings

Definition at line 127 of file qgssymbollayerregistry.cpp.

◆ operator=()

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

◆ removeSymbolLayerType()

bool QgsSymbolLayerRegistry::removeSymbolLayerType ( QgsSymbolLayerAbstractMetadata * metadata)

Removes a symbol layer type.

Since
QGIS 3.22.2

Definition at line 111 of file qgssymbollayerregistry.cpp.

◆ resolveFonts()

void QgsSymbolLayerRegistry::resolveFonts ( const QString & name,
QVariantMap & properties,
const QgsReadWriteContext & context ) const

Resolve fonts from the properties of a particular symbol layer.

This tests whether the required fonts from the encoded properties are available on the system, and records warnings in the context if not.

Since
QGIS 3.20

Definition at line 171 of file qgssymbollayerregistry.cpp.

◆ resolvePaths()

void QgsSymbolLayerRegistry::resolvePaths ( const QString & name,
QVariantMap & properties,
const QgsPathResolver & pathResolver,
bool saving ) const

Resolve paths in properties of a particular symbol layer.

This normally means converting relative paths to absolute paths when loading and converting absolute paths to relative paths when saving.

Definition at line 163 of file qgssymbollayerregistry.cpp.

◆ symbolLayerMetadata()

QgsSymbolLayerAbstractMetadata * QgsSymbolLayerRegistry::symbolLayerMetadata ( const QString & name) const

Returns metadata for specified symbol layer. Returns nullptr if not found.

Definition at line 122 of file qgssymbollayerregistry.cpp.

◆ symbolLayersForType()

QStringList QgsSymbolLayerRegistry::symbolLayersForType ( Qgis::SymbolType type)

Returns a list of available symbol layers for a specified symbol type.

Definition at line 179 of file qgssymbollayerregistry.cpp.


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