16#ifndef QGSSTYLEMODEL_H
17#define QGSSTYLEMODEL_H
22#include <QAbstractItemModel>
23#include <QSortFilterProxyModel>
67 void setIconSizes(
const QList< QSize > &sizes );
74 QList< QSize > iconSizes()
const;
85 void setTargetScreenProperties(
const QSet< QgsScreenProperties > &properties );
96 QSet< QgsScreenProperties > targetScreenProperties()
const;
108 QList< QSize > mIconSizes;
109 QSet< QgsScreenProperties > mTargetScreenProperties;
146 TypeRole = Qt::UserRole + 1,
172 QVariant data(
const QModelIndex &index,
int role )
const override;
173 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
174 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
175 QVariant headerData(
int section, Qt::Orientation orientation,
176 int role = Qt::DisplayRole )
const override;
177 QModelIndex index(
int row,
int column,
178 const QModelIndex &parent = QModelIndex() )
const override;
179 QModelIndex parent(
const QModelIndex &index )
const override;
180 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
181 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
189 void addDesiredIconSize( QSize size );
218 void onTagsChanged(
int entity,
const QString &name,
const QStringList &tags );
219 void rebuildSymbolIcons();
226 QHash< QgsStyle::StyleEntity, QStringList > mEntityNames;
228 QSet< QgsScreenProperties > mTargetScreenProperties;
230 QList< QSize > mAdditionalSizes;
231 mutable std::unique_ptr< QgsExpressionContext > mExpressionContext;
233 mutable QHash< QgsStyle::StyleEntity, QHash< QString, QIcon > > mIconCache;
236 mutable QSet< QString > mPending3dSymbolIcons;
241 static QVariant headerDataStatic(
int section, Qt::Orientation orientation,
242 int role = Qt::DisplayRole );
321 void setEntityFilters(
const QList<QgsStyle::StyleEntity> &filters )
SIP_SKIP;
329 bool entityFilterEnabled()
const;
340 void setEntityFilterEnabled(
bool enabled );
367 bool symbolTypeFilterEnabled()
const;
379 void setSymbolTypeFilterEnabled(
bool enabled );
409 void setTagId(
int id );
431 void setTagString(
const QString &tag );
441 QString tagString()
const;
453 void setSmartGroupId(
int id );
464 int smartGroupId()
const;
466 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
467 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
474 bool favoritesOnly()
const;
481 void setFavoritesOnly(
bool favoritesOnly );
489 void addDesiredIconSize( QSize size );
509 void setFilterString(
const QString &filter );
519 QString mFilterString;
522 QStringList mTaggedSymbolNames;
526 int mSmartGroupId = -1;
527 QStringList mSmartGroupSymbolNames;
529 bool mFavoritesOnly =
false;
531 bool mEntityFilterEnabled =
false;
532 QList< QgsStyle::StyleEntity > mEntityFilters = QList< QgsStyle::StyleEntity >() <<
QgsStyle::SymbolEntity;
534 bool mSymbolTypeFilterEnabled =
false;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
SymbolType
Attribute editing capabilities which may be supported by vector data providers.
An abstract base class for icon generators for a QgsStyleModel.
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 ...
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 ...
@ StyleName
Name of associated QgsStyle (QgsStyle::name()) (since QGIS 3.26)
@ LayerTypeRole
Layer type (for label settings entities)
@ StyleFileName
File name of associated QgsStyle (QgsStyle::fileName()) (since QGIS 3.26)
@ EntityName
Entity name (since QGIS 3.26)
@ CompatibleGeometryTypesRole
Compatible layer geometry types (for 3D symbols)
@ IsFavoriteRole
Whether entity is flagged as a favorite.
@ SymbolTypeRole
Symbol type (for symbol or legend patch shape entities)
@ IsTitleRole
True if the index corresponds to a title item (since QGIS 3.26)
@ TagRole
String list of tags.
QgsStyle * style()
Returns the style managed by the model.
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle ...
QString filterString() const
Returns the current filter string, if set.
StyleEntity
Enum for Entities involved in a style.
Abstract base class for all rendered symbols.