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

A symbol converter for converting ESRI REST JSON symbols. More...

#include <qgssymbolconverteresrirest.h>

Inheritance diagram for QgsSymbolConverterEsriRest:

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 ()

Static Public Member Functions

static QColor convertColor (const QVariant &data)
 Converts ESRI JSON color data to a QColor object.
static Qt::BrushStyle convertFillStyle (const QString &style)
 Converts an ESRI fill style to a Qt brush style.
static Qt::PenStyle convertLineStyle (const QString &style)
 Converts an ESRI line style to a Qt pen style.

Friends

class TestQgsArcGisRestUtils

Detailed Description

A symbol converter for converting ESRI REST JSON symbols.

Since
QGIS 4.2

Definition at line 33 of file qgssymbolconverteresrirest.h.

Member Function Documentation

◆ capabilities()

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

Returns the capabilities of the converter.

Implements QgsAbstractSymbolConverter.

Definition at line 30 of file qgssymbolconverteresrirest.cpp.

◆ convertColor()

QColor QgsSymbolConverterEsriRest::convertColor ( const QVariant & data)
static

Converts ESRI JSON color data to a QColor object.

Definition at line 349 of file qgssymbolconverteresrirest.cpp.

◆ convertFillStyle()

Qt::BrushStyle QgsSymbolConverterEsriRest::convertFillStyle ( const QString & style)
static

Converts an ESRI fill style to a Qt brush style.

Definition at line 380 of file qgssymbolconverteresrirest.cpp.

◆ convertLineStyle()

Qt::PenStyle QgsSymbolConverterEsriRest::convertLineStyle ( const QString & style)
static

Converts an ESRI line style to a Qt pen style.

Definition at line 362 of file qgssymbolconverteresrirest.cpp.

◆ createSymbol()

std::unique_ptr< QgsSymbol > QgsSymbolConverterEsriRest::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 50 of file qgssymbolconverteresrirest.cpp.

◆ formatName()

QString QgsSymbolConverterEsriRest::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 40 of file qgssymbolconverteresrirest.cpp.

◆ name()

QString QgsSymbolConverterEsriRest::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 35 of file qgssymbolconverteresrirest.cpp.

◆ toVariant()

QVariant QgsSymbolConverterEsriRest::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 45 of file qgssymbolconverteresrirest.cpp.

◆ TestQgsArcGisRestUtils

friend class TestQgsArcGisRestUtils
friend

Definition at line 67 of file qgssymbolconverteresrirest.h.


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