16 #ifndef QGSSTYLEMODEL_H
17 #define QGSSTYLEMODEL_H
19 #include "qgis_core.h"
23 #include <QAbstractItemModel>
24 #include <QSortFilterProxyModel>
61 TypeRole = Qt::UserRole + 1,
82 QVariant data(
const QModelIndex &index,
int role )
const override;
83 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
84 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
85 QVariant headerData(
int section, Qt::Orientation orientation,
86 int role = Qt::DisplayRole )
const override;
87 QModelIndex index(
int row,
int column,
88 const QModelIndex &parent = QModelIndex() )
const override;
89 QModelIndex parent(
const QModelIndex &index )
const override;
90 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
91 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
99 void addDesiredIconSize( QSize size );
107 void onTagsChanged(
int entity,
const QString &name,
const QStringList &tags );
108 void rebuildSymbolIcons();
114 QHash< QgsStyle::StyleEntity, QStringList > mEntityNames;
116 QList< QSize > mAdditionalSizes;
117 mutable std::unique_ptr< QgsExpressionContext > mExpressionContext;
119 mutable QHash< QgsStyle::StyleEntity, QHash< QString, QIcon > > mIconCache;
190 void setEntityFilters(
const QList<QgsStyle::StyleEntity> &filters )
SIP_SKIP;
198 bool entityFilterEnabled()
const;
209 void setEntityFilterEnabled(
bool enabled );
236 bool symbolTypeFilterEnabled()
const;
248 void setSymbolTypeFilterEnabled(
bool enabled );
276 void setTagId(
int id );
295 void setSmartGroupId(
int id );
304 int smartGroupId()
const;
306 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
313 bool favoritesOnly()
const;
320 void setFavoritesOnly(
bool favoritesOnly );
328 void addDesiredIconSize( QSize size );
338 void setFilterString(
const QString &filter );
347 QString mFilterString;
350 QStringList mTaggedSymbolNames;
352 int mSmartGroupId = -1;
353 QStringList mSmartGroupSymbolNames;
355 bool mFavoritesOnly =
false;
357 bool mEntityFilterEnabled =
false;
358 QList< QgsStyle::StyleEntity > mEntityFilters = QList< QgsStyle::StyleEntity >() <<
QgsStyle::SymbolEntity;
360 bool mSymbolTypeFilterEnabled =
false;
367 #endif //QGSSTYLEMODEL_H