16 #ifndef QGSSTYLEMODEL_H
17 #define QGSSTYLEMODEL_H
19 #include "qgis_core.h"
23 #include <QAbstractItemModel>
24 #include <QSortFilterProxyModel>
67 void setIconSizes(
const QList< QSize > &sizes );
74 QList< QSize > iconSizes()
const;
86 QList< QSize > mIconSizes;
123 TypeRole = Qt::UserRole + 1,
145 QVariant data(
const QModelIndex &index,
int role )
const override;
146 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
147 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
148 QVariant headerData(
int section, Qt::Orientation orientation,
149 int role = Qt::DisplayRole )
const override;
150 QModelIndex index(
int row,
int column,
151 const QModelIndex &parent = QModelIndex() )
const override;
152 QModelIndex parent(
const QModelIndex &index )
const override;
153 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
154 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
162 void addDesiredIconSize( QSize size );
180 void onTagsChanged(
int entity,
const QString &name,
const QStringList &tags );
181 void rebuildSymbolIcons();
188 QHash< QgsStyle::StyleEntity, QStringList > mEntityNames;
190 QList< QSize > mAdditionalSizes;
191 mutable std::unique_ptr< QgsExpressionContext > mExpressionContext;
193 mutable QHash< QgsStyle::StyleEntity, QHash< QString, QIcon > > mIconCache;
196 mutable QSet< QString > mPending3dSymbolIcons;
267 void setEntityFilters(
const QList<QgsStyle::StyleEntity> &filters )
SIP_SKIP;
275 bool entityFilterEnabled()
const;
286 void setEntityFilterEnabled(
bool enabled );
313 bool symbolTypeFilterEnabled()
const;
325 void setSymbolTypeFilterEnabled(
bool enabled );
353 void setTagId(
int id );
372 void setSmartGroupId(
int id );
381 int smartGroupId()
const;
383 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
390 bool favoritesOnly()
const;
397 void setFavoritesOnly(
bool favoritesOnly );
405 void addDesiredIconSize( QSize size );
415 void setFilterString(
const QString &filter );
424 QString mFilterString;
427 QStringList mTaggedSymbolNames;
429 int mSmartGroupId = -1;
430 QStringList mSmartGroupSymbolNames;
432 bool mFavoritesOnly =
false;
434 bool mEntityFilterEnabled =
false;
435 QList< QgsStyle::StyleEntity > mEntityFilters = QList< QgsStyle::StyleEntity >() <<
QgsStyle::SymbolEntity;
437 bool mSymbolTypeFilterEnabled =
false;
444 #endif //QGSSTYLEMODEL_H