QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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
22#include <QConcatenateTablesProxyModel>
23#include <QSet>
24#include <QtGlobal>
25
26class QgsStyle;
27class QgsStyleModel;
30
40class CORE_EXPORT QgsCombinedStyleModel: public QConcatenateTablesProxyModel
41{
42
43 Q_OBJECT
44
45 public:
46
50 explicit QgsCombinedStyleModel( QObject *parent SIP_TRANSFERTHIS = nullptr );
51
52 QVariant headerData( int section, Qt::Orientation orientation,
53 int role = Qt::DisplayRole ) const override;
54
64 void addStyle( QgsStyle *style );
65
71 void addDefaultStyle();
72
78 void removeStyle( QgsStyle *style );
79
85 QList< QgsStyle * > styles() const;
86
93 void addDesiredIconSize( QSize size );
94
103 void addTargetScreenProperties( const QgsScreenProperties &properties );
104
105 private:
106
107 QList< QgsStyle * > mStyles;
108 QHash< QgsStyle *, QgsStyleModel * > mOwnedStyleModels;
109 QHash< QgsStyle *, QgsSingleItemModel * > mTitleModels;
110
111 QList< QSize > mAdditionalSizes;
112 QSet< QgsScreenProperties > mTargetScreenProperties;
113
114};
115
116#endif //QGSCOMBINEDSTYLEMODEL_H
void addTargetScreenProperties(const QgsScreenProperties &properties)
Adds additional target screen properties to use when generating icons for Qt::DecorationRole data.
QList< QgsStyle * > styles() const
Returns a list of all styles shown in the model.
QVariant headerData(int section, Qt::Orientation orientation, int role=Qt::DisplayRole) const override
QgsCombinedStyleModel(QObject *parent=nullptr)
Constructor for QgsCombinedStyleModel with the specified parent object.
void removeStyle(QgsStyle *style)
Removes a style from the model.
void addStyle(QgsStyle *style)
Adds a style to the model.
void addDefaultStyle()
Adds the default style (QgsStyle::defaultStyle()) to the model.
void addDesiredIconSize(QSize size)
Adds an additional icon size to generate for Qt::DecorationRole data.
Stores properties relating to a screen.
A QAbstractItemModel subclass which contains a single read-only item.
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle ...
A database of saved style entities, including symbols, color ramps, text formats and others.
Definition qgsstyle.h:88
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:53