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

A symbol converter for converting MapBox GL JSON values to QgsSymbol objects. More...

#include <qgssymbolconvertermapboxgl.h>

Inheritance diagram for QgsSymbolConverterMapBoxGl:

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 MapBox GL JSON values to QgsSymbol objects.

Since
QGIS 4.2

Definition at line 29 of file qgssymbolconvertermapboxgl.h.

Member Function Documentation

◆ capabilities()

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

Returns the capabilities of the converter.

Implements QgsAbstractSymbolConverter.

Definition at line 29 of file qgssymbolconvertermapboxgl.cpp.

◆ createSymbol()

std::unique_ptr< QgsSymbol > QgsSymbolConverterMapBoxGl::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 49 of file qgssymbolconvertermapboxgl.cpp.

◆ formatName()

QString QgsSymbolConverterMapBoxGl::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 39 of file qgssymbolconvertermapboxgl.cpp.

◆ name()

QString QgsSymbolConverterMapBoxGl::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 34 of file qgssymbolconvertermapboxgl.cpp.

◆ toVariant()

QVariant QgsSymbolConverterMapBoxGl::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 44 of file qgssymbolconvertermapboxgl.cpp.


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