16#ifndef QGSSTYLEMODEL_H
17#define QGSSTYLEMODEL_H
23#include <QAbstractItemModel>
26#include <QSortFilterProxyModel>
107 QList< QSize > mIconSizes;
108 QSet< QgsScreenProperties > mTargetScreenProperties;
179 QVariant data(
const QModelIndex &index,
int role )
const override;
180 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
181 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
182 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
183 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
184 QModelIndex parent(
const QModelIndex &index )
const override;
185 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
186 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
194 void addDesiredIconSize( QSize size );
223 void onTagsChanged(
int entity,
const QString &name,
const QStringList &tags );
224 void rebuildSymbolIcons();
228 void initStyleModel();
232 QHash< QgsStyle::StyleEntity, QStringList > mEntityNames;
234 QSet< QgsScreenProperties > mTargetScreenProperties;
236 QList< QSize > mAdditionalSizes;
237 mutable std::unique_ptr< QgsExpressionContext > mExpressionContext;
239 mutable QHash< QgsStyle::StyleEntity, QHash< QString, QIcon > > mIconCache;
242 mutable QSet< QString > mPending3dSymbolIcons;
243 mutable QSet< QString > mPendingMaterialSettingsIcons;
248 static QVariant headerDataStatic(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole );
326 void setEntityFilters(
const QList<QgsStyle::StyleEntity> &filters )
SIP_SKIP;
334 bool entityFilterEnabled()
const;
345 void setEntityFilterEnabled(
bool enabled );
372 bool symbolTypeFilterEnabled()
const;
384 void setSymbolTypeFilterEnabled(
bool enabled );
411 bool renderingTechniqueFilterEnabled()
const;
424 void setRenderingTechniqueFilterEnabled(
bool enabled );
456 void setTagId(
int id );
478 void setTagString(
const QString &tag );
488 QString tagString()
const;
500 void setSmartGroupId(
int id );
511 int smartGroupId()
const;
513 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
514 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
521 bool favoritesOnly()
const;
528 void setFavoritesOnly(
bool favoritesOnly );
536 void addDesiredIconSize( QSize size );
556 void setFilterString(
const QString &filter );
565 QString mFilterString;
568 QStringList mTaggedSymbolNames;
572 int mSmartGroupId = -1;
573 QStringList mSmartGroupSymbolNames;
575 bool mFavoritesOnly =
false;
577 bool mEntityFilterEnabled =
false;
578 QList< QgsStyle::StyleEntity > mEntityFilters = QList< QgsStyle::StyleEntity >() <<
QgsStyle::SymbolEntity;
580 bool mSymbolTypeFilterEnabled =
false;
585 bool mRenderingTechniqueFilterEnabled =
false;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
MaterialRenderingTechnique
Material rendering techniques.
@ Triangles
Triangle based rendering (default).
An abstract base class for icon generators for a QgsStyleModel.
void setTargetScreenProperties(const QSet< QgsScreenProperties > &properties)
Sets the target screen properties to use when generating icons.
void setIconSizes(const QList< QSize > &sizes)
Sets the list of icon sizes to generate.
virtual void generateIcon(QgsStyle *style, QgsStyle::StyleEntity type, const QString &name)=0
Triggers generation of an icon for an entity from the specified style database, with matching entity ...
QgsAbstractStyleEntityIconGenerator(QObject *parent)
Constructor for QgsAbstractStyleEntityIconGenerator, with the specified parent object.
QSet< QgsScreenProperties > targetScreenProperties() const
Returns the target screen properties to use when generating icons.
QList< QSize > iconSizes() const
Returns the list of icon sizes to generate.
void iconGenerated(QgsStyle::StyleEntity type, const QString &name, const QIcon &icon)
Emitted when the icon for the style entity with matching type and name has been generated.
A model which contains entities from multiple QgsStyle databases.
Stores properties relating to a screen.
A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle ...
CustomRole
Custom model roles.
friend class QgsCombinedStyleModel
QgsStyleModel(QgsStyle *style, QObject *parent=nullptr)
Constructor for QgsStyleModel, for the specified style and parent object.
QgsStyle * style()
Returns the style managed by the model.
QString filterString() const
Returns the current filter string, if set.
QgsStyleProxyModel(QgsStyle *style, QObject *parent=nullptr)
Constructor for QgsStyleProxyModel, for the specified style and parent object.
A database of saved style entities, including symbols, color ramps, text formats and others.
StyleEntity
Enum for Entities involved in a style.
Abstract base class for all rendered symbols.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)