QGIS API Documentation 3.41.0-Master (3440c17df1d)
|
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. | |
QgsSymbolLayer * | createSymbolLayer (const QString &name, const QVariantMap &properties=QVariantMap()) const |
create a new instance of symbol layer given symbol layer name and properties | |
QgsSymbolLayer * | createSymbolLayerFromSld (const QString &name, QDomElement &element) const |
create a new instance of symbol layer given symbol layer name and SLD | |
QgsSymbolLayerRegistry & | operator= (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. | |
QgsSymbolLayerAbstractMetadata * | symbolLayerMetadata (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 QgsSymbolLayer * | defaultSymbolLayer (Qgis::SymbolType type) |
create a new instance of symbol layer for specified symbol type with default settings | |
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.
QgsSymbolLayerRegistry::QgsSymbolLayerRegistry | ( | ) |
Definition at line 29 of file qgssymbollayerregistry.cpp.
QgsSymbolLayerRegistry::~QgsSymbolLayerRegistry | ( | ) |
Definition at line 93 of file qgssymbollayerregistry.cpp.
|
delete |
bool QgsSymbolLayerRegistry::addSymbolLayerType | ( | QgsSymbolLayerAbstractMetadata * | metadata | ) |
Registers a new symbol layer type. Takes ownership of the metadata instance.
Definition at line 98 of file qgssymbollayerregistry.cpp.
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 144 of file qgssymbollayerregistry.cpp.
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 152 of file qgssymbollayerregistry.cpp.
|
static |
create a new instance of symbol layer for specified symbol type with default settings
Definition at line 123 of file qgssymbollayerregistry.cpp.
|
delete |
bool QgsSymbolLayerRegistry::removeSymbolLayerType | ( | QgsSymbolLayerAbstractMetadata * | metadata | ) |
Removes a symbol layer type.
Definition at line 107 of file qgssymbollayerregistry.cpp.
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.
Definition at line 168 of file qgssymbollayerregistry.cpp.
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 160 of file qgssymbollayerregistry.cpp.
QgsSymbolLayerAbstractMetadata * QgsSymbolLayerRegistry::symbolLayerMetadata | ( | const QString & | name | ) | const |
Returns metadata for specified symbol layer. Returns nullptr
if not found.
Definition at line 118 of file qgssymbollayerregistry.cpp.
QStringList QgsSymbolLayerRegistry::symbolLayersForType | ( | Qgis::SymbolType | type | ) |
Returns a list of available symbol layers for a specified symbol type.
Definition at line 176 of file qgssymbollayerregistry.cpp.