QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
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 Q_OBJECT
43
44 public:
48 explicit QgsCombinedStyleModel( QObject *parent SIP_TRANSFERTHIS = nullptr );
49
50 QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
51
61 void addStyle( QgsStyle *style );
62
68 void addDefaultStyle();
69
75 void removeStyle( QgsStyle *style );
76
82 QList< QgsStyle * > styles() const;
83
90 void addDesiredIconSize( QSize size );
91
100 void addTargetScreenProperties( const QgsScreenProperties &properties );
101
102 private:
103 QList< QgsStyle * > mStyles;
104 QHash< QgsStyle *, QgsStyleModel * > mOwnedStyleModels;
105 QHash< QgsStyle *, QgsSingleItemModel * > mTitleModels;
106
107 QList< QSize > mAdditionalSizes;
108 QSet< QgsScreenProperties > mTargetScreenProperties;
109};
110
111#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:89
#define SIP_TRANSFERTHIS
Definition qgis_sip.h:52