QGIS API Documentation 4.1.0-Master (3b8ef1f72a3)
Loading...
Searching...
No Matches
qgssymbolconverterregistry.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgssymbolconverterregistry.cpp
3 -----------------
4 begin : February 2026
5 copyright : (C) 2026 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
20#include "qgssymbolconverter.h"
26
27#include "moc_qgssymbolconverterregistry.cpp"
28
30 : QObject( parent )
31{}
32
34{
35 qDeleteAll( mConverters );
36}
37
46
48{
49 if ( !converter )
50 return false;
51
52 if ( mConverters.contains( converter->name() ) )
53 return false;
54
55 mConverters.insert( converter->name(), converter );
56 return true;
57}
58
60{
61 return mConverters.value( name, nullptr );
62}
63
65{
66 if ( !mConverters.contains( name ) )
67 return false;
68
69 delete mConverters.take( name );
70 return true;
71}
72
74{
75 return mConverters.keys();
76}
An abstract base class for converting between QgsSymbol objects and QVariant representations.
A symbol converter for converting ESRI REST JSON symbols.
A symbol converter for converting MapBox GL JSON values to QgsSymbol objects.
A symbol converter for converting QgsSymbol objects to and from the OGR style string format.
A symbol converter for converting QgsSymbol objects to and from QGIS's native QML XML format.
bool addConverter(QgsAbstractSymbolConverter *converter)
Adds a converter to the registry.
QgsSymbolConverterRegistry(QObject *parent=nullptr)
Creates a new empty symbol converter registry.
QStringList converterNames() const
Returns a list of the registered converter names (IDs).
QgsAbstractSymbolConverter * converter(const QString &name) const
Returns the converter with matching name, or nullptr if no matching converter is registered.
bool removeConverter(const QString &name)
Removes the converter with matching name.
void populate()
Adds the default symbol converters to the registry.
A symbol converter for converting QgsSymbol objects to and from the Styled Layer Descriptor (SLD) for...