QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsstyle.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsstyle.h
3 ---------------------
4 begin : November 2009
5 copyright : (C) 2009 by Martin Dobias
6 email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSSTYLE_H
17#define QGSSTYLE_H
18
19#include <sqlite3.h>
20
21#include "qgis.h"
22#include "qgis_core.h"
23#include "qgslegendpatchshape.h"
24#include "qgspallabeling.h"
25#include "qgssqliteutils.h"
26#include "qgssymbollayerutils.h"
27#include "qgstextformat.h"
28
29#include <QMap>
30#include <QMultiMap>
31#include <QString>
32
33class QgsSymbol;
34class QgsSymbolLayer;
35class QgsColorRamp;
38class QDomDocument;
39class QDomElement;
40
41typedef QMap<QString, QgsColorRamp * > QgsVectorColorRampMap;
42typedef QMap<int, QString> QgsSymbolGroupMap;
43
48typedef QMap<QString, QgsTextFormat > QgsTextFormatMap;
49
54typedef QMap<QString, QgsPalLayerSettings > QgsLabelSettingsMap;
55
56/*
57 * Constants used to describe copy-paste MIME types
58 */
59#define QGSCLIPBOARD_STYLE_MIME "application/qgis.style"
60#define QGSCLIPBOARD_STYLES_MIME "application/qgis.styles"
61
80typedef QMultiMap<QString, QString> QgsSmartConditionMap;
81
82
88class CORE_EXPORT QgsStyle : public QObject
89{
90 Q_OBJECT
91
92 public:
93
99 enum class SymbolTableColumn : int
100 {
101 Id,
102 Name,
103 XML,
104 FavoriteId,
105 };
106 Q_ENUM( SymbolTableColumn )
107
108
113 enum class TagTableColumn : int
114 {
115 Id,
116 Name,
117 };
118 Q_ENUM( TagTableColumn )
119
120
125 enum class TagmapTableColumn : int
126 {
127 TagId,
128 SymbolId,
129 };
130 Q_ENUM( TagmapTableColumn )
131
132
137 enum class ColorRampTableColumn : int
138 {
139 Id,
140 Name,
141 XML,
142 FavoriteId,
143 };
144 Q_ENUM( ColorRampTableColumn )
145
146
151 enum class TextFormatTableColumn : int
152 {
153 Id,
154 Name,
155 XML,
156 FavoriteId,
157 };
158 Q_ENUM( TextFormatTableColumn )
159
160
166 {
167 Id,
168 Name,
169 XML,
170 FavoriteId,
171 };
172 Q_ENUM( LabelSettingsTableColumn )
173
174
179 enum class SmartGroupTableColumn : int
180 {
181 Id,
182 Name,
183 XML,
184 };
185 Q_ENUM( SmartGroupTableColumn )
186
187
190 QgsStyle( QObject *parent SIP_TRANSFERTHIS = nullptr );
191 ~QgsStyle() override;
192
215
222 QString name() const;
223
230 void setName( const QString &name );
231
241 bool isInitialized() const { return mInitialized; }
242
252 bool isReadOnly() const;
253
263 void setReadOnly( bool readOnly );
264
276 bool addEntity( const QString &name, const QgsStyleEntityInterface *entity, bool update = false );
277
287 bool addSymbol( const QString &name, QgsSymbol *symbol SIP_TRANSFER, bool update = false );
288
297 bool addColorRamp( const QString &name, QgsColorRamp *colorRamp SIP_TRANSFER, bool update = false );
298
309 bool addTextFormat( const QString &name, const QgsTextFormat &format, bool update = false );
310
321 bool addLabelSettings( const QString &name, const QgsPalLayerSettings &settings, bool update = false );
322
333 bool addLegendPatchShape( const QString &name, const QgsLegendPatchShape &shape, bool update = false );
334
345 bool addSymbol3D( const QString &name, QgsAbstract3DSymbol *symbol SIP_TRANSFER, bool update = false );
346
353 int addTag( const QString &tagName );
354
364 int addSmartgroup( const QString &name, const QString &op, const QgsSmartConditionMap &conditions ) SIP_SKIP;
365
378 int addSmartgroup( const QString &name, const QString &op, const QStringList &matchTag, const QStringList &noMatchTag,
379 const QStringList &matchName, const QStringList &noMatchName );
380
386 QStringList tags() const;
387
389 void clear();
390
395 QgsColorRamp *colorRamp( const QString &name ) const SIP_FACTORY;
396
398 int colorRampCount();
399
401 QStringList colorRampNames() const;
402
404 const QgsColorRamp *colorRampRef( const QString &name ) const;
405
410 int colorrampId( const QString &name );
411
417 QgsTextFormat textFormat( const QString &name ) const;
418
423 int textFormatCount() const;
424
429 QStringList textFormatNames() const;
430
437 int textFormatId( const QString &name );
438
444 QgsPalLayerSettings labelSettings( const QString &name ) const;
445
451 QgsLegendPatchShape legendPatchShape( const QString &name ) const;
452
457 int legendPatchShapesCount() const;
458
466 Qgis::SymbolType legendPatchShapeSymbolType( const QString &name ) const;
467
473 QgsAbstract3DSymbol *symbol3D( const QString &name ) const SIP_FACTORY;
474
479 int symbol3DCount() const;
480
487 QList< Qgis::GeometryType > symbol3DCompatibleGeometryTypes( const QString &name ) const;
488
496 Qgis::GeometryType labelSettingsLayerType( const QString &name ) const;
497
502 int labelSettingsCount() const;
503
508 QStringList labelSettingsNames() const;
509
516 int labelSettingsId( const QString &name );
517
526 static QgsStyle *defaultStyle( bool initialize = true );
527
529 static void cleanDefaultStyle() SIP_SKIP;
530
540 bool tagSymbol( StyleEntity type, const QString &symbol, const QStringList &tags );
541
551 bool detagSymbol( StyleEntity type, const QString &symbol, const QStringList &tags );
552
561 bool detagSymbol( StyleEntity type, const QString &symbol );
562
564 bool removeSymbol( const QString &name );
565
573 bool renameEntity( StyleEntity type, const QString &oldName, const QString &newName );
574
580 bool renameSymbol( const QString &oldName, const QString &newName );
581
583 QgsSymbol *symbol( const QString &name ) SIP_FACTORY;
584
586 const QgsSymbol *symbolRef( const QString &name ) const;
587
589 int symbolCount();
590
592 QStringList symbolNames() const;
593
598 int symbolId( const QString &name );
599
604 int entityId( StyleEntity type, const QString &name );
605
607 int tagId( const QString &tag );
609 int smartgroupId( const QString &smartgroup );
610
615 QStringList allNames( StyleEntity type ) const;
616
623 QStringList symbolsOfFavorite( StyleEntity type ) const;
624
632 QStringList symbolsWithTag( StyleEntity type, int tagid ) const;
633
641 bool addFavorite( StyleEntity type, const QString &name );
642
650 bool removeFavorite( StyleEntity type, const QString &name );
651
659 bool rename( StyleEntity type, int id, const QString &newName );
660
669 bool remove( StyleEntity type, int id );
670
677 bool removeEntityByName( StyleEntity type, const QString &name );
678
688 bool saveSymbol( const QString &name, const QgsSymbol *symbol, bool favorite, const QStringList &tags );
689
699 bool saveColorRamp( const QString &name, const QgsColorRamp *ramp, bool favorite, const QStringList &tags );
700
702 bool removeColorRamp( const QString &name );
703
705 bool renameColorRamp( const QString &oldName, const QString &newName );
706
716 bool saveTextFormat( const QString &name, const QgsTextFormat &format, bool favorite, const QStringList &tags );
717
722 bool removeTextFormat( const QString &name );
723
729 bool renameTextFormat( const QString &oldName, const QString &newName );
730
740 bool saveLabelSettings( const QString &name, const QgsPalLayerSettings &settings, bool favorite, const QStringList &tags );
741
746 bool removeLabelSettings( const QString &name );
747
753 bool renameLabelSettings( const QString &oldName, const QString &newName );
754
766 bool saveLegendPatchShape( const QString &name, const QgsLegendPatchShape &shape, bool favorite, const QStringList &tags );
767
773 bool renameLegendPatchShape( const QString &oldName, const QString &newName );
774
779 QStringList legendPatchShapeNames() const;
780
788 const QgsSymbol *previewSymbolForPatchShape( const QgsLegendPatchShape &shape ) const;
789
796 QgsLegendPatchShape defaultPatch( Qgis::SymbolType type, QSizeF size ) const;
797
804 QList< QList< QPolygonF > > defaultPatchAsQPolygonF( Qgis::SymbolType type, QSizeF size ) const;
805
811 enum class TextFormatContext : int
812 {
813 Labeling,
814 };
815
822
828 static QgsTextFormat defaultTextFormatForProject( QgsProject *project, QgsStyle::TextFormatContext context = QgsStyle::TextFormatContext::Labeling );
829
841 bool saveSymbol3D( const QString &name, QgsAbstract3DSymbol *symbol SIP_TRANSFER, bool favorite, const QStringList &tags );
842
848 bool renameSymbol3D( const QString &oldName, const QString &newName );
849
854 QStringList symbol3DNames() const;
855
863 bool createDatabase( const QString &filename );
864
872 bool createMemoryDatabase();
873
881 void createTables();
882
893 bool load( const QString &filename );
894
909 Q_DECL_DEPRECATED bool save( const QString &filename = QString() ) SIP_DEPRECATED;
910
916 QString errorString() const { return mErrorString; }
917
927 QString fileName() const { return mFileName; }
928
940 void setFileName( const QString &filename );
941
949 QStringList findSymbols( StyleEntity type, const QString &qword );
950
958 QStringList tagsOfSymbol( StyleEntity type, const QString &symbol );
959
966 bool isFavorite( StyleEntity type, const QString &name );
967
976 bool symbolHasTag( StyleEntity type, const QString &symbol, const QString &tag );
977
979 QString tag( int id ) const;
980
982 QgsSymbolGroupMap smartgroupsListMap();
983
985 QStringList smartgroupNames() const;
986
988 QgsSmartConditionMap smartgroup( int id );
989
993 QString smartgroupOperator( int id );
994
996 QStringList symbolsOfSmartgroup( StyleEntity type, int id );
997
999 bool exportXml( const QString &filename );
1000
1002 bool importXml( const QString &filename );
1003
1012 static bool isXmlStyleFile( const QString &path );
1013
1014 public slots:
1015#ifndef SIP_RUN
1016
1024 void triggerIconRebuild();
1025#endif
1026
1027 signals:
1028
1038
1049
1058 void symbolSaved( const QString &name, const QgsSymbol *symbol );
1059
1068 void symbolChanged( const QString &name );
1069
1072
1078 void entityTagsChanged( QgsStyle::StyleEntity entity, const QString &name, const QStringList &newTags );
1079
1085 void favoritedChanged( QgsStyle::StyleEntity entity, const QString &name, bool isFavorite );
1086
1092 void entityAdded( QgsStyle::StyleEntity entity, const QString &name );
1093
1100 void entityRemoved( QgsStyle::StyleEntity entity, const QString &name );
1101
1106 void entityRenamed( QgsStyle::StyleEntity entity, const QString &oldName, const QString &newName );
1107
1114 void entityChanged( QgsStyle::StyleEntity entity, const QString &name );
1115
1123 void symbolRemoved( const QString &name );
1124
1130 void symbolRenamed( const QString &oldName, const QString &newName );
1131
1137 void rampRenamed( const QString &oldName, const QString &newName );
1138
1146 void rampAdded( const QString &name );
1147
1155 void rampRemoved( const QString &name );
1156
1165 void rampChanged( const QString &name );
1166
1172 void textFormatRenamed( const QString &oldName, const QString &newName );
1173
1181 void textFormatAdded( const QString &name );
1182
1190 void textFormatRemoved( const QString &name );
1191
1200 void textFormatChanged( const QString &name );
1201
1207 void labelSettingsRenamed( const QString &oldName, const QString &newName );
1208
1216 void labelSettingsAdded( const QString &name );
1217
1225 void labelSettingsRemoved( const QString &name );
1226
1235 void labelSettingsChanged( const QString &name );
1236
1243
1244 private:
1245
1246 bool mInitialized = true;
1247 QString mName;
1248 bool mReadOnly = false;
1249
1250 QgsSymbolMap mSymbols;
1251 QgsVectorColorRampMap mColorRamps;
1252 QgsTextFormatMap mTextFormats;
1253 QgsLabelSettingsMap mLabelSettings;
1254 QMap<QString, QgsLegendPatchShape > mLegendPatchShapes;
1255 QMap<QString, QgsAbstract3DSymbol * > m3dSymbols;
1256
1257 QHash< QgsStyle::StyleEntity, QHash< QString, QStringList > > mCachedTags;
1258 QHash< QgsStyle::StyleEntity, QHash< QString, bool > > mCachedFavorites;
1259
1260 QString mErrorString;
1261 QString mFileName;
1262
1263 sqlite3_database_unique_ptr mCurrentDB;
1264
1265 std::unique_ptr< QgsSymbol > mPatchMarkerSymbol;
1266 std::unique_ptr< QgsSymbol > mPatchLineSymbol;
1267 std::unique_ptr< QgsSymbol > mPatchFillSymbol;
1268
1269 mutable QHash< int, QHash< QSizeF, QgsLegendPatchShape > > mDefaultPatchCache;
1270 mutable QHash< int, QHash< QSizeF, QList< QList< QPolygonF > > > > mDefaultPatchQPolygonFCache;
1271
1272 QMap< QString, QDomElement > mDeferred3DsymbolElements;
1273 void handleDeferred3DSymbolCreation();
1274
1275 static QgsStyle *sDefaultStyle;
1276
1282 void initializeDefaultStyle( const QString &filename );
1283
1285 bool openDatabase( const QString &filename );
1286
1288 bool importXml( const QString &filename, int sinceVersion );
1289
1296 bool runEmptyQuery( const QString &query );
1297
1299 int getId( const QString &table, const QString &name );
1300
1302 QString getName( const QString &table, int id ) const;
1303
1312 bool updateSymbol( StyleEntity type, const QString &name );
1313
1314 void clearCachedTags( StyleEntity type, const QString &name );
1315
1319 bool createStyleMetadataTableIfNeeded();
1320 void upgradeIfRequired();
1321
1325 static QString entityTableName( StyleEntity type );
1326
1330 static QString tagmapTableName( StyleEntity type );
1331
1335 static QString tagmapEntityIdFieldName( StyleEntity type );
1336
1337 friend class Qgs3D;
1338 friend class TestStyle;
1339
1340 Q_DISABLE_COPY( QgsStyle )
1341};
1342
1350{
1351
1352#ifdef SIP_RUN
1354 switch ( sipCpp->type() )
1355 {
1357 sipType = sipType_QgsStyleSymbolEntity;
1358 break;
1359
1361 sipType = sipType_QgsStyleColorRampEntity;
1362 break;
1363
1365 sipType = sipType_QgsStyleTextFormatEntity;
1366 break;
1367
1369 sipType = sipType_QgsStyleLabelSettingsEntity;
1370 break;
1371
1374 sipType = 0;
1375 break;
1376 }
1377 SIP_END
1378#endif
1379
1380 public:
1381
1382 virtual ~QgsStyleEntityInterface() = default;
1383
1387 virtual QgsStyle::StyleEntity type() const = 0;
1388
1389};
1390
1398{
1399 public:
1400
1407 : mSymbol( symbol )
1408 {}
1409
1410 QgsStyle::StyleEntity type() const override;
1411
1415 QgsSymbol *symbol() const { return mSymbol; }
1416
1417 private:
1418
1419 QgsSymbol *mSymbol = nullptr;
1420
1421};
1422
1430{
1431 public:
1432
1439 : mRamp( ramp )
1440 {}
1441
1442 QgsStyle::StyleEntity type() const override;
1443
1447 QgsColorRamp *ramp() const { return mRamp; }
1448
1449 private:
1450
1451 QgsColorRamp *mRamp = nullptr;
1452};
1453
1461{
1462 public:
1463
1468 : mFormat( format )
1469 {}
1470
1471 QgsStyle::StyleEntity type() const override;
1472
1476 QgsTextFormat format() const { return mFormat; }
1477
1478 private:
1479
1480 QgsTextFormat mFormat;
1481
1482};
1483
1491{
1492 public:
1493
1500
1501 QgsStyle::StyleEntity type() const override;
1502
1503
1507 const QgsPalLayerSettings &settings() const { return mSettings; }
1508
1509 private:
1510
1511 QgsPalLayerSettings mSettings;
1512};
1513
1521{
1522 public:
1523
1530
1531 QgsStyle::StyleEntity type() const override;
1532
1533
1537 const QgsLegendPatchShape &shape() const { return mShape; }
1538
1539 private:
1540
1541 QgsLegendPatchShape mShape;
1542};
1543
1551{
1552 public:
1553
1560 : mSymbol( symbol )
1561 {}
1562
1563 QgsStyle::StyleEntity type() const override;
1564
1568 const QgsAbstract3DSymbol *symbol() const { return mSymbol; }
1569
1570 private:
1571
1572 const QgsAbstract3DSymbol *mSymbol = nullptr;
1573};
1574
1575#endif
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:59
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Definition qgis.h:365
SymbolType
Symbol types.
Definition qgis.h:629
Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.
Abstract base class for color ramps.
Represents a patch shape for use in map legends.
Contains settings for how a map layer will be labeled.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:112
QgsStyleColorRampEntity(QgsColorRamp *ramp)
Constructor for QgsStyleColorRampEntity, with the specified color ramp.
Definition qgsstyle.h:1438
QgsColorRamp * ramp() const
Returns the entity's color ramp.
Definition qgsstyle.h:1447
An interface for entities which can be placed in a QgsStyle database.
Definition qgsstyle.h:1350
virtual QgsStyle::StyleEntity type() const =0
Returns the type of style entity.
virtual ~QgsStyleEntityInterface()=default
const QgsPalLayerSettings & settings() const
Returns the entity's label settings.
Definition qgsstyle.h:1507
QgsStyleLabelSettingsEntity(const QgsPalLayerSettings &settings)
Constructor for QgsStyleLabelSettingsEntity, with the specified label settings.
Definition qgsstyle.h:1497
const QgsLegendPatchShape & shape() const
Returns the entity's legend patch shape.
Definition qgsstyle.h:1537
QgsStyleLegendPatchShapeEntity(const QgsLegendPatchShape &shape)
Constructor for QgsStyleLegendPatchShapeEntity, with the specified legend patch shape.
Definition qgsstyle.h:1527
const QgsAbstract3DSymbol * symbol() const
Returns the entity's symbol.
Definition qgsstyle.h:1568
QgsStyleSymbol3DEntity(const QgsAbstract3DSymbol *symbol)
Constructor for QgsStyleSymbol3DEntity, with the specified symbol.
Definition qgsstyle.h:1559
QgsStyleSymbolEntity(QgsSymbol *symbol)
Constructor for QgsStyleSymbolEntity, with the specified symbol.
Definition qgsstyle.h:1406
QgsSymbol * symbol() const
Returns the entity's symbol.
Definition qgsstyle.h:1415
QgsTextFormat format() const
Returns the entity's text format.
Definition qgsstyle.h:1476
QgsStyleTextFormatEntity(const QgsTextFormat &format)
Constructor for QgsStyleTextFormatEntity, with the specified text format.
Definition qgsstyle.h:1467
A database of saved style entities, including symbols, color ramps, text formats and others.
Definition qgsstyle.h:89
void labelSettingsChanged(const QString &name)
Emitted whenever a label setting's definition is changed.
QString errorString() const
Returns the last error from a load() operation.
Definition qgsstyle.h:916
void entityChanged(QgsStyle::StyleEntity entity, const QString &name)
Emitted whenever an entity's definition is changed.
void labelSettingsAdded(const QString &name)
Emitted whenever label settings have been added to the style and the database has been updated as a r...
void rampAdded(const QString &name)
Emitted whenever a color ramp has been added to the style and the database has been updated as a resu...
void rebuildIconPreviews()
Emitted whenever icon previews for entities in the style must be rebuilt.
void aboutToBeDestroyed()
Emitted just before the style object is destroyed.
LabelSettingsTableColumn
Columns available in the label settings table.
Definition qgsstyle.h:166
QgsSymbol * symbol(const QString &name)
Returns a NEW copy of symbol.
Definition qgsstyle.cpp:320
void labelSettingsRemoved(const QString &name)
Emitted whenever label settings have been removed from the style and the database has been updated as...
StyleEntity
Enum for Entities involved in a style.
Definition qgsstyle.h:205
@ LabelSettingsEntity
Label settings.
Definition qgsstyle.h:211
@ TextFormatEntity
Text formats.
Definition qgsstyle.h:210
@ SmartgroupEntity
Smart groups.
Definition qgsstyle.h:209
@ Symbol3DEntity
3D symbol entity
Definition qgsstyle.h:213
@ SymbolEntity
Symbols.
Definition qgsstyle.h:206
@ TagEntity
Tags.
Definition qgsstyle.h:207
@ ColorrampEntity
Color ramps.
Definition qgsstyle.h:208
@ LegendPatchShapeEntity
Legend patch shape.
Definition qgsstyle.h:212
void symbolRenamed(const QString &oldName, const QString &newName)
Emitted whenever a symbol has been renamed from oldName to newName.
ColorRampTableColumn
Columns available in the color ramp table.
Definition qgsstyle.h:138
void groupsModified()
Emitted every time a tag or smartgroup has been added, removed, or renamed.
void rampRemoved(const QString &name)
Emitted whenever a color ramp has been removed from the style and the database has been updated as a ...
void entityRenamed(QgsStyle::StyleEntity entity, const QString &oldName, const QString &newName)
Emitted whenever a entity of the specified type has been renamed from oldName to newName.
void textFormatChanged(const QString &name)
Emitted whenever a text format's definition is changed.
void symbolSaved(const QString &name, const QgsSymbol *symbol)
Emitted every time a new symbol has been added to the database.
void textFormatRenamed(const QString &oldName, const QString &newName)
Emitted whenever a text format has been renamed from oldName to newName.
void labelSettingsRenamed(const QString &oldName, const QString &newName)
Emitted whenever label settings have been renamed from oldName to newName.
void initialized()
Emitted when the style database has been fully initialized.
TextFormatTableColumn
Columns available in the text format table.
Definition qgsstyle.h:152
QString fileName() const
Returns the current file name of the style database.
Definition qgsstyle.h:927
void rampRenamed(const QString &oldName, const QString &newName)
Emitted whenever a color ramp has been renamed from oldName to newName.
bool isInitialized() const
Returns true if the style is initialized and ready for use.
Definition qgsstyle.h:241
SmartGroupTableColumn
Columns available in the smart group table.
Definition qgsstyle.h:180
TagTableColumn
Columns available in the Tags table.
Definition qgsstyle.h:114
void textFormatAdded(const QString &name)
Emitted whenever a text format has been added to the style and the database has been updated as a res...
bool isFavorite(StyleEntity type, const QString &name)
Returns true if the symbol with matching type and name is marked as a favorite.
QString name() const
Returns the name of the style.
Definition qgsstyle.cpp:111
QgsStyle(QObject *parent=nullptr)
Constructor for QgsStyle, with the specified parent object.
Definition qgsstyle.cpp:84
SymbolTableColumn
Columns available in the Symbols table.
Definition qgsstyle.h:100
TagmapTableColumn
Columns available in the tag to symbol table.
Definition qgsstyle.h:126
void rampChanged(const QString &name)
Emitted whenever a color ramp's definition is changed.
void entityTagsChanged(QgsStyle::StyleEntity entity, const QString &name, const QStringList &newTags)
Emitted whenever an entity's tags are changed.
friend class Qgs3D
Definition qgsstyle.h:1337
void favoritedChanged(QgsStyle::StyleEntity entity, const QString &name, bool isFavorite)
Emitted whenever an entity is either favorited or un-favorited.
void entityRemoved(QgsStyle::StyleEntity entity, const QString &name)
Emitted whenever an entity of the specified type is removed from the style and the database has been ...
void entityAdded(QgsStyle::StyleEntity entity, const QString &name)
Emitted every time a new entity has been added to the database.
TextFormatContext
Text format context.
Definition qgsstyle.h:812
@ Labeling
Text format used in labeling.
Definition qgsstyle.h:813
void symbolRemoved(const QString &name)
Emitted whenever a symbol has been removed from the style and the database has been updated as a resu...
friend class TestStyle
Definition qgsstyle.h:1338
void symbolChanged(const QString &name)
Emitted whenever a symbol's definition is changed.
void textFormatRemoved(const QString &name)
Emitted whenever a text format has been removed from the style and the database has been updated as a...
bool importXml(const QString &filename)
Imports the symbols and colorramps into the default style database from the given XML file.
Abstract base class for symbol layers.
Abstract base class for all rendered symbols.
Definition qgssymbol.h:231
Container for all settings relating to text rendering.
Unique pointer for sqlite3 databases, which automatically closes the database when the pointer goes o...
QMultiMap< QString, QString > QgsSmartConditionMap
A multimap to hold the smart group conditions as constraint and parameter pairs.
Definition qgsstyle.h:80
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition qgis_sip.h:199
#define SIP_DEPRECATED
Definition qgis_sip.h:114
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_FACTORY
Definition qgis_sip.h:84
#define SIP_END
Definition qgis_sip.h:216
QMap< QString, QgsSymbol * > QgsSymbolMap
Definition qgsrenderer.h:52
QMap< QString, QgsPalLayerSettings > QgsLabelSettingsMap
Map of name to label settings.
Definition qgsstyle.h:54
QMap< QString, QgsTextFormat > QgsTextFormatMap
Map of name to text format.
Definition qgsstyle.h:48
QMap< QString, QgsColorRamp * > QgsVectorColorRampMap
Definition qgsstyle.h:41
QMap< int, QString > QgsSymbolGroupMap
Definition qgsstyle.h:42