QGIS API Documentation  3.23.0-Master (c716e02dd3)
Public Member Functions | Protected Attributes | List of all members
QgsSymbolLayerMetadata Class Reference

Convenience metadata class that uses static functions to create symbol layer and its widget. More...

#include <qgssymbollayerregistry.h>

Inheritance diagram for QgsSymbolLayerMetadata:
Inheritance graph
[legend]

Public Member Functions

 QgsSymbolLayerMetadata (const QString &name, const QString &visibleName, Qgis::SymbolType type, QgsSymbolLayerCreateFunc pfCreate, QgsSymbolLayerCreateFromSldFunc pfCreateFromSld=nullptr, QgsSymbolLayerPathResolverFunc pfPathResolver=nullptr, QgsSymbolLayerWidgetFunc pfWidget=nullptr, QgsSymbolLayerFontResolverFunc pfFontResolver=nullptr)
 
QgsSymbolLayerCreateFromSldFunc createFromSldFunction () const
 
QgsSymbolLayerCreateFunc createFunction () const
 
QgsSymbolLayercreateSymbolLayer (const QVariantMap &map) override
 Create a symbol layer of this type given the map of properties. More...
 
QgsSymbolLayercreateSymbolLayerFromSld (QDomElement &elem) override
 Create a symbol layer of this type given the map of properties. More...
 
QgsSymbolLayerWidgetcreateSymbolLayerWidget (QgsVectorLayer *vl) override
 Create widget for symbol layer of this type. Can return nullptr if there's no GUI. More...
 
QgsSymbolLayerPathResolverFunc pathResolverFunction () const
 
void resolveFonts (const QVariantMap &properties, const QgsReadWriteContext &context) override
 Resolve fonts from the symbol layer's properties. More...
 
void resolvePaths (QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving) override
 Resolve paths in symbol layer's properties (if there are any paths). More...
 
void setWidgetFunction (QgsSymbolLayerWidgetFunc f)
 
QgsSymbolLayerWidgetFunc widgetFunction () const
 

Protected Attributes

QgsSymbolLayerCreateFromSldFunc mCreateFromSldFunc
 
QgsSymbolLayerCreateFunc mCreateFunc
 
QgsSymbolLayerFontResolverFunc mFontResolverFunc
 Font resolver function pointer. More...
 
QgsSymbolLayerPathResolverFunc mPathResolverFunc
 
QgsSymbolLayerWidgetFunc mWidgetFunc
 

Detailed Description

Convenience metadata class that uses static functions to create symbol layer and its widget.

Definition at line 110 of file qgssymbollayerregistry.h.

Constructor & Destructor Documentation

◆ QgsSymbolLayerMetadata()

QgsSymbolLayerMetadata::QgsSymbolLayerMetadata ( const QString &  name,
const QString &  visibleName,
Qgis::SymbolType  type,
QgsSymbolLayerCreateFunc  pfCreate,
QgsSymbolLayerCreateFromSldFunc  pfCreateFromSld = nullptr,
QgsSymbolLayerPathResolverFunc  pfPathResolver = nullptr,
QgsSymbolLayerWidgetFunc  pfWidget = nullptr,
QgsSymbolLayerFontResolverFunc  pfFontResolver = nullptr 
)
inline
Note
not available in Python bindings

Definition at line 114 of file qgssymbollayerregistry.h.

Member Function Documentation

◆ createFromSldFunction()

QgsSymbolLayerCreateFromSldFunc QgsSymbolLayerMetadata::createFromSldFunction ( ) const
inline
Note
not available in Python bindings

Definition at line 134 of file qgssymbollayerregistry.h.

◆ createFunction()

QgsSymbolLayerCreateFunc QgsSymbolLayerMetadata::createFunction ( ) const
inline
Note
not available in Python bindings

Definition at line 130 of file qgssymbollayerregistry.h.

◆ createSymbolLayer()

QgsSymbolLayer* QgsSymbolLayerMetadata::createSymbolLayer ( const QVariantMap &  map)
inlineoverridevirtual

Create a symbol layer of this type given the map of properties.

Implements QgsSymbolLayerAbstractMetadata.

Definition at line 141 of file qgssymbollayerregistry.h.

◆ createSymbolLayerFromSld()

QgsSymbolLayer* QgsSymbolLayerMetadata::createSymbolLayerFromSld ( QDomElement &  )
inlineoverridevirtual

Create a symbol layer of this type given the map of properties.

Reimplemented from QgsSymbolLayerAbstractMetadata.

Definition at line 143 of file qgssymbollayerregistry.h.

◆ createSymbolLayerWidget()

QgsSymbolLayerWidget* QgsSymbolLayerMetadata::createSymbolLayerWidget ( QgsVectorLayer )
inlineoverridevirtual

Create widget for symbol layer of this type. Can return nullptr if there's no GUI.

Reimplemented from QgsSymbolLayerAbstractMetadata.

Definition at line 142 of file qgssymbollayerregistry.h.

◆ pathResolverFunction()

QgsSymbolLayerPathResolverFunc QgsSymbolLayerMetadata::pathResolverFunction ( ) const
inline
Note
not available in Python bindings

Definition at line 136 of file qgssymbollayerregistry.h.

◆ resolveFonts()

void QgsSymbolLayerMetadata::resolveFonts ( const QVariantMap &  properties,
const QgsReadWriteContext context 
)
inlineoverridevirtual

Resolve fonts from the symbol layer's properties.

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

Reimplemented from QgsSymbolLayerAbstractMetadata.

Definition at line 150 of file qgssymbollayerregistry.h.

◆ resolvePaths()

void QgsSymbolLayerMetadata::resolvePaths ( QVariantMap &  properties,
const QgsPathResolver pathResolver,
bool  saving 
)
inlineoverridevirtual

Resolve paths in symbol layer's properties (if there are any paths).

When saving is true, paths are converted from absolute to relative, when saving is false, paths are converted from relative to absolute. This ensures that paths in project files can be relative, but in symbol layer instances the paths are always absolute

Since
QGIS 3.0

Reimplemented from QgsSymbolLayerAbstractMetadata.

Definition at line 144 of file qgssymbollayerregistry.h.

◆ setWidgetFunction()

void QgsSymbolLayerMetadata::setWidgetFunction ( QgsSymbolLayerWidgetFunc  f)
inline
Note
not available in Python bindings

Definition at line 139 of file qgssymbollayerregistry.h.

◆ widgetFunction()

QgsSymbolLayerWidgetFunc QgsSymbolLayerMetadata::widgetFunction ( ) const
inline
Note
not available in Python bindings

Definition at line 132 of file qgssymbollayerregistry.h.

Member Data Documentation

◆ mCreateFromSldFunc

QgsSymbolLayerCreateFromSldFunc QgsSymbolLayerMetadata::mCreateFromSldFunc
protected

Definition at line 159 of file qgssymbollayerregistry.h.

◆ mCreateFunc

QgsSymbolLayerCreateFunc QgsSymbolLayerMetadata::mCreateFunc
protected

Definition at line 157 of file qgssymbollayerregistry.h.

◆ mFontResolverFunc

QgsSymbolLayerFontResolverFunc QgsSymbolLayerMetadata::mFontResolverFunc
protected

Font resolver function pointer.

Since
QGIS 3.20

Definition at line 167 of file qgssymbollayerregistry.h.

◆ mPathResolverFunc

QgsSymbolLayerPathResolverFunc QgsSymbolLayerMetadata::mPathResolverFunc
protected

Definition at line 160 of file qgssymbollayerregistry.h.

◆ mWidgetFunc

QgsSymbolLayerWidgetFunc QgsSymbolLayerMetadata::mWidgetFunc
protected

Definition at line 158 of file qgssymbollayerregistry.h.


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