QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgscombinedstylemodel.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgscombinedstylemodel.h
3  ---------------
4  begin : May 2022
5  copyright : (C) 2022 by Nyall Dawson
6  email : nyall dot dawson 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 QGSCOMBINEDSTYLEMODEL_H
17 #define QGSCOMBINEDSTYLEMODEL_H
18 
19 #include "qgis_core.h"
20 #include "qgis_sip.h"
21 #include <QtGlobal>
22 
23 SIP_IF_MODULE( CONCATENATED_TABLES_MODEL )
24 
25 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
26 #include <QConcatenateTablesProxyModel>
27 
28 class QgsStyle;
29 class QgsStyleModel;
30 class QgsSingleItemModel;
31 
32 
42 class CORE_EXPORT QgsCombinedStyleModel: public QConcatenateTablesProxyModel
43 {
44 
45  Q_OBJECT
46 
47  public:
48 
52  explicit QgsCombinedStyleModel( QObject *parent SIP_TRANSFERTHIS = nullptr );
53 
54  QVariant headerData( int section, Qt::Orientation orientation,
55  int role = Qt::DisplayRole ) const override;
56 
66  void addStyle( QgsStyle *style );
67 
73  void addDefaultStyle();
74 
80  void removeStyle( QgsStyle *style );
81 
87  QList< QgsStyle * > styles() const;
88 
95  void addDesiredIconSize( QSize size );
96 
97  private:
98 
99  QList< QgsStyle * > mStyles;
100  QHash< QgsStyle *, QgsStyleModel * > mOwnedStyleModels;
101  QHash< QgsStyle *, QgsSingleItemModel * > mTitleModels;
102 
103  QList< QSize > mAdditionalSizes;
104 
105 };
106 #endif
107 
108 #endif //QGSCOMBINEDSTYLEMODEL_H
QgsStyleModel
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle ...
Definition: qgsstylemodel.h:107
QgsCombinedStyleModel
A model which contains entities from multiple QgsStyle databases.
Definition: qgscombinedstylemodel.h:42
QgsSingleItemModel
A QgsSingleItemModel subclass which contains a single read-only item.
Definition: qgssingleitemmodel.h:31
qgis_sip.h
SIP_IF_MODULE
#define SIP_IF_MODULE(condition)
Definition: qgis_sip.h:28
QgsStyle
Definition: qgsstyle.h:159
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53