16 #ifndef QGSSTYLEITEMSLISTWIDGET_H
17 #define QGSSTYLEITEMSLISTWIDGET_H
19 #include "ui_qgsstyleitemslistwidgetbase.h"
23 #include <QStyledItemDelegate>
38 explicit QgsReadOnlyStyleModel(
QgsStyleModel *sourceModel, QObject *parent =
nullptr );
39 explicit QgsReadOnlyStyleModel(
QgsStyle *style, QObject *parent =
nullptr );
41 #if QT_VERSION >= QT_VERSION_CHECK(5, 13, 0)
45 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
46 QVariant data(
const QModelIndex &index,
int role )
const override;
57 class QgsStyleModelDelegate :
public QStyledItemDelegate
66 QgsStyleModelDelegate( QObject *parent );
68 QSize sizeHint(
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
69 void paint( QPainter *painter,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
113 void setEntityTypes(
const QList<QgsStyle::StyleEntity> &filters )
SIP_SKIP;
133 QString currentTagFilter()
const;
142 QMenu *advancedMenu();
153 void setAdvancedMenu( QMenu *menu );
162 void showAdvancedButton(
bool enabled );
169 QString currentItemName()
const;
179 void showEvent( QShowEvent *event )
override;
198 void selectionChangedWithStylePath(
const QString &name,
QgsStyle::StyleEntity type,
const QString &stylePath );
210 void groupsCombo_currentIndexChanged(
int index );
211 void updateModelFilters();
212 void onSelectionChanged(
const QModelIndex &index );
213 void populateGroups();
214 void openStyleManager();
219 QgsStyleModelDelegate *mDelegate =
nullptr;
220 bool mUpdatingGroups =
false;
223 #endif //QGSSTYLEITEMSLISTWIDGET_H