16#ifndef QGSMAPLAYERSTYLECATEGORIESMODEL_H
17#define QGSMAPLAYERSTYLECATEGORIESMODEL_H
23#include <QAbstractListModel>
24#include <QItemDelegate>
40 NameRole = Qt::UserRole + 1,
55 void setShowAllCategories(
bool showAll );
57 int rowCount(
const QModelIndex & = QModelIndex() )
const override;
58 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
59 QVariant data(
const QModelIndex &index,
int role )
const override;
60 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
61 Qt::ItemFlags flags(
const QModelIndex & )
const override;
69 QList<QgsMapLayer::StyleCategory> mCategoryList;
71 bool mShowAllCategories =
false;
89 void drawDisplay( QPainter *painter,
const QStyleOptionViewItem &option,
const QRect &rect,
const QString &text )
const override;
90 QSize
sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
LayerType
Types of layers that can be added to a map.
void drawDisplay(QPainter *painter, const QStyleOptionViewItem &option, const QRect &rect, const QString &text) const override
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const override
QgsCategoryDisplayLabelDelegate(QObject *parent=nullptr)
constructor
Model for layer style categories.
QgsMapLayerStyleCategoriesModel(Qgis::LayerType type, QObject *parent=nullptr)
Constructor for QgsMapLayerStyleCategoriesModel, for the specified layer type.
QFlags< StyleCategory > StyleCategories