QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
Loading...
Searching...
No Matches
QgsSymbolConverterSld Class Reference

A symbol converter for converting QgsSymbol objects to and from the Styled Layer Descriptor (SLD) format. More...

#include <qgssymbolconvertersld.h>

Inheritance diagram for QgsSymbolConverterSld:

Public Member Functions

Qgis::SymbolConverterCapabilities capabilities () const override
 Returns the capabilities of the converter.
std::unique_ptr< QgsSymbolcreateSymbol (const QVariant &variant, QgsSymbolConverterContext &context) const override
 Creates a new QgsSymbol from a QVariant representation.
QString formatName () const override
 Returns a translated, user-friendly name for the converter's data format.
QString name () const override
 Returns the unique name for the converter.
QVariant toVariant (const QgsSymbol *symbol, QgsSymbolConverterContext &context) const override
 Converts a symbol into a QVariant representation.
Public Member Functions inherited from QgsAbstractSymbolConverter
virtual ~QgsAbstractSymbolConverter ()

Detailed Description

A symbol converter for converting QgsSymbol objects to and from the Styled Layer Descriptor (SLD) format.

Since
QGIS 4.2

Definition at line 29 of file qgssymbolconvertersld.h.

Member Function Documentation

◆ capabilities()

Qgis::SymbolConverterCapabilities QgsSymbolConverterSld::capabilities ( ) const
overridevirtual

Returns the capabilities of the converter.

Implements QgsAbstractSymbolConverter.

Definition at line 34 of file qgssymbolconvertersld.cpp.

◆ createSymbol()

std::unique_ptr< QgsSymbol > QgsSymbolConverterSld::createSymbol ( const QVariant & variant,
QgsSymbolConverterContext & context ) const
overridevirtual

Creates a new QgsSymbol from a QVariant representation.

Parameters
variantThe QVariant containing the serialized symbol data.
contextconversion context
Returns
A new QgsSymbol instance representing the data in the variant. The caller takes ownership of the returned object. Returns nullptr if the variant cannot be converted or parsed.
Exceptions
QgsNotSupportedExceptionif the converter does not support deserialization of symbols.

Implements QgsAbstractSymbolConverter.

Definition at line 75 of file qgssymbolconvertersld.cpp.

◆ formatName()

QString QgsSymbolConverterSld::formatName ( ) const
overridevirtual

Returns a translated, user-friendly name for the converter's data format.

E.g. "Styled Layer Descriptor (SLD)" for a converter which handles the SLD format.

See also
name()

Implements QgsAbstractSymbolConverter.

Definition at line 44 of file qgssymbolconvertersld.cpp.

◆ name()

QString QgsSymbolConverterSld::name ( ) const
overridevirtual

Returns the unique name for the converter.

This should be an untranslated string identifying the converter.

See also
formatName()

Implements QgsAbstractSymbolConverter.

Definition at line 39 of file qgssymbolconvertersld.cpp.

◆ toVariant()

QVariant QgsSymbolConverterSld::toVariant ( const QgsSymbol * symbol,
QgsSymbolConverterContext & context ) const
overridevirtual

Converts a symbol into a QVariant representation.

The resulting QVariant may be a dictionary (QVariantMap), a JSON string, an XML representation of the symbol, or some binary QByteArray value, depending on the concrete implementation (e.g., SLD vs. Mapbox GL).

Returns an invalid variant if the symbol could not be converted, or if serialization of symbols is not supported for this converter.

Exceptions
QgsNotSupportedExceptionif the converter does not support serialization of symbols.

Implements QgsAbstractSymbolConverter.

Definition at line 49 of file qgssymbolconvertersld.cpp.


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