16 #ifndef QGSSTYLEMODEL_H 17 #define QGSSTYLEMODEL_H 19 #include "qgis_core.h" 23 #include <QAbstractItemModel> 24 #include <QSortFilterProxyModel> 57 TypeRole = Qt::UserRole + 1,
69 QVariant data(
const QModelIndex &index,
int role )
const override;
70 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
71 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
72 QVariant headerData(
int section, Qt::Orientation orientation,
73 int role = Qt::DisplayRole )
const override;
74 QModelIndex index(
int row,
int column,
75 const QModelIndex &parent = QModelIndex() )
const override;
76 QModelIndex parent(
const QModelIndex &index )
const override;
77 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
78 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
86 void addDesiredIconSize( QSize size );
90 void onSymbolAdded(
const QString &name,
QgsSymbol *symbol );
91 void onSymbolRemoved(
const QString &name );
92 void onSymbolChanged(
const QString &name );
93 void onSymbolRename(
const QString &oldName,
const QString &newName );
94 void onRampAdded(
const QString &name );
95 void onRampRemoved(
const QString &name );
96 void onRampChanged(
const QString &name );
97 void onRampRename(
const QString &oldName,
const QString &newName );
98 void onTagsChanged(
int entity,
const QString &name,
const QStringList &tags );
99 void rebuildSymbolIcons();
104 QStringList mSymbolNames;
105 QStringList mRampNames;
106 QList< QSize > mAdditionalSizes;
108 mutable QHash< QString, QIcon > mSymbolIconCache;
109 mutable QHash< QString, QIcon > mColorRampIconCache;
166 bool entityFilterEnabled()
const;
177 void setEntityFilterEnabled(
bool enabled );
204 bool symbolTypeFilterEnabled()
const;
216 void setSymbolTypeFilterEnabled(
bool enabled );
226 void setTagId(
int id );
245 void setSmartGroupId(
int id );
254 int smartGroupId()
const;
256 bool filterAcceptsRow(
int source_row,
const QModelIndex &source_parent )
const override;
263 bool favoritesOnly()
const;
270 void setFavoritesOnly(
bool favoritesOnly );
278 void addDesiredIconSize( QSize size );
288 void setFilterString(
const QString &filter );
295 QString mFilterString;
298 QStringList mTaggedSymbolNames;
300 int mSmartGroupId = -1;
301 QStringList mSmartGroupSymbolNames;
303 bool mFavoritesOnly =
false;
304 QStringList mFavoritedSymbolNames;
306 bool mEntityFilterEnabled =
false;
309 bool mSymbolTypeFilterEnabled =
false;
314 #endif //QGSSTYLEMODEL_H A QAbstractItemModel subclass for showing symbol and color ramp entities contained within a QgsStyle ...
Abstract base class for all rendered symbols.
StyleEntity
Enum for Entities involved in a style.
QString filterString() const
Returns the current filter string, if set.
SymbolType
Type of the symbol.
A QSortFilterProxyModel subclass for showing filtered symbol and color ramps entries from a QgsStyle ...
Symbol type (for symbol entities)