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;
181 QVariant data(
const QModelIndex &index,
int role )
const override;
182 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
183 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
184 QVariant headerData(
int section, Qt::Orientation orientation,
185 int role = Qt::DisplayRole )
const override;
186 QModelIndex index(
int row,
int column,
187 const QModelIndex &parent = QModelIndex() )
const override;
188 QModelIndex parent(
const QModelIndex &index )
const override;
189 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
190 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
198 void addDesiredIconSize( QSize size );
227 void onTagsChanged(
int entity,
const QString &name,
const QStringList &tags );
228 void rebuildSymbolIcons();
233 void initStyleModel();
237 QHash< QgsStyle::StyleEntity, QStringList > mEntityNames;
239 QSet< QgsScreenProperties > mTargetScreenProperties;
241 QList< QSize > mAdditionalSizes;
242 mutable std::unique_ptr< QgsExpressionContext > mExpressionContext;
244 mutable QHash< QgsStyle::StyleEntity, QHash< QString, QIcon > > mIconCache;
247 mutable QSet< QString > mPending3dSymbolIcons;
252 static QVariant headerDataStatic(
int section, Qt::Orientation orientation,
253 int role = Qt::DisplayRole );
332 void setEntityFilters(
const QList<QgsStyle::StyleEntity> &filters )
SIP_SKIP;
340 bool entityFilterEnabled()
const;
351 void setEntityFilterEnabled(
bool enabled );
378 bool symbolTypeFilterEnabled()
const;
390 void setSymbolTypeFilterEnabled(
bool enabled );
420 void setTagId(
int id );
442 void setTagString(
const QString &tag );
452 QString tagString()
const;
464 void setSmartGroupId(
int id );
475 int smartGroupId()
const;
477 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
478 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
485 bool favoritesOnly()
const;
492 void setFavoritesOnly(
bool favoritesOnly );
500 void addDesiredIconSize( QSize size );
520 void setFilterString(
const QString &filter );
530 QString mFilterString;
533 QStringList mTaggedSymbolNames;
537 int mSmartGroupId = -1;
538 QStringList mSmartGroupSymbolNames;
540 bool mFavoritesOnly =
false;
542 bool mEntityFilterEnabled =
false;
543 QList< QgsStyle::StyleEntity > mEntityFilters = QList< QgsStyle::StyleEntity >() <<
QgsStyle::SymbolEntity;
545 bool mSymbolTypeFilterEnabled =
false;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
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 ...
CustomRole
Custom model roles.
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.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)