QGIS API Documentation 3.41.0-Master (3440c17df1d)
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
QgsSymbolLayerAbstractMetadata Class Referenceabstract

Stores metadata about one symbol layer class. More...

#include <qgssymbollayerregistry.h>

Inheritance diagram for QgsSymbolLayerAbstractMetadata:
Inheritance graph
[legend]

Public Member Functions

 QgsSymbolLayerAbstractMetadata (const QString &name, const QString &visibleName, Qgis::SymbolType type)
 Constructor for QgsSymbolLayerAbstractMetadata.
 
virtual ~QgsSymbolLayerAbstractMetadata ()=default
 
virtual QgsSymbolLayercreateSymbolLayer (const QVariantMap &map)=0
 Create a symbol layer of this type given the map of properties.
 
virtual QgsSymbolLayercreateSymbolLayerFromSld (QDomElement &)
 Create a symbol layer of this type given the map of properties.
 
virtual QgsSymbolLayerWidgetcreateSymbolLayerWidget (QgsVectorLayer *)
 Create widget for symbol layer of this type. Can return nullptr if there's no GUI.
 
QString name () const
 
virtual void resolveFonts (const QVariantMap &properties, const QgsReadWriteContext &context)
 Resolve fonts from the symbol layer's properties.
 
virtual void resolvePaths (QVariantMap &properties, const QgsPathResolver &pathResolver, bool saving)
 Resolve paths in symbol layer's properties (if there are any paths).
 
Qgis::SymbolType type () const
 
QString visibleName () const
 

Protected Attributes

QString mName
 
Qgis::SymbolType mType
 
QString mVisibleName
 

Detailed Description

Stores metadata about one symbol layer class.

Note
It's necessary to implement createSymbolLayer() function. In C++ you can use QgsSymbolLayerMetadata convenience class.

Definition at line 36 of file qgssymbollayerregistry.h.

Constructor & Destructor Documentation

◆ QgsSymbolLayerAbstractMetadata()

QgsSymbolLayerAbstractMetadata::QgsSymbolLayerAbstractMetadata ( const QString &  name,
const QString &  visibleName,
Qgis::SymbolType  type 
)
inline

Constructor for QgsSymbolLayerAbstractMetadata.

Parameters
nameinternal symbol layer name (unique identifier)
visibleNameuser visible, translated name for symbol layer
typeassociated symbol type

Definition at line 46 of file qgssymbollayerregistry.h.

◆ ~QgsSymbolLayerAbstractMetadata()

virtual QgsSymbolLayerAbstractMetadata::~QgsSymbolLayerAbstractMetadata ( )
virtualdefault

Member Function Documentation

◆ createSymbolLayer()

virtual QgsSymbolLayer * QgsSymbolLayerAbstractMetadata::createSymbolLayer ( const QVariantMap &  map)
pure virtual

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

Implemented in QgsSymbolLayerMetadata.

◆ createSymbolLayerFromSld()

virtual QgsSymbolLayer * QgsSymbolLayerAbstractMetadata::createSymbolLayerFromSld ( QDomElement &  )
inlinevirtual

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

Reimplemented in QgsSymbolLayerMetadata.

Definition at line 63 of file qgssymbollayerregistry.h.

◆ createSymbolLayerWidget()

virtual QgsSymbolLayerWidget * QgsSymbolLayerAbstractMetadata::createSymbolLayerWidget ( QgsVectorLayer )
inlinevirtual

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

Reimplemented in QgsSymbolLayerMetadata.

Definition at line 61 of file qgssymbollayerregistry.h.

◆ name()

QString QgsSymbolLayerAbstractMetadata::name ( ) const
inline

Definition at line 54 of file qgssymbollayerregistry.h.

◆ resolveFonts()

virtual void QgsSymbolLayerAbstractMetadata::resolveFonts ( const QVariantMap &  properties,
const QgsReadWriteContext context 
)
inlinevirtual

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 in QgsSymbolLayerMetadata.

Definition at line 87 of file qgssymbollayerregistry.h.

◆ resolvePaths()

virtual void QgsSymbolLayerAbstractMetadata::resolvePaths ( QVariantMap &  properties,
const QgsPathResolver pathResolver,
bool  saving 
)
inlinevirtual

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

Reimplemented in QgsSymbolLayerMetadata.

Definition at line 72 of file qgssymbollayerregistry.h.

◆ type()

Qgis::SymbolType QgsSymbolLayerAbstractMetadata::type ( ) const
inline

Definition at line 56 of file qgssymbollayerregistry.h.

◆ visibleName()

QString QgsSymbolLayerAbstractMetadata::visibleName ( ) const
inline

Definition at line 55 of file qgssymbollayerregistry.h.

Member Data Documentation

◆ mName

QString QgsSymbolLayerAbstractMetadata::mName
protected

Definition at line 94 of file qgssymbollayerregistry.h.

◆ mType

Qgis::SymbolType QgsSymbolLayerAbstractMetadata::mType
protected

Definition at line 96 of file qgssymbollayerregistry.h.

◆ mVisibleName

QString QgsSymbolLayerAbstractMetadata::mVisibleName
protected

Definition at line 95 of file qgssymbollayerregistry.h.


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