15 #ifndef QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H 16 #define QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H 21 #include <QStandardItem> 22 #include <QProxyStyle> 27 #include "ui_qgscategorizedsymbolrendererv2widget.h" 34 class GUI_EXPORT QgsCategorizedSymbolRendererModel :
public QAbstractItemModel
38 QgsCategorizedSymbolRendererModel( QObject *parent =
nullptr );
39 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
40 Qt::DropActions supportedDropActions()
const override;
41 QVariant data(
const QModelIndex &index,
int role )
const override;
42 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
43 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
44 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
45 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
46 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
47 QModelIndex parent(
const QModelIndex &index )
const override;
48 QStringList mimeTypes()
const override;
49 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
50 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
56 void deleteRows( QList<int> rows );
58 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
59 void updateSymbology();
73 class QgsCategorizedSymbolRendererViewStyle:
public QProxyStyle
78 explicit QgsCategorizedSymbolRendererViewStyle( QStyle *style =
nullptr );
80 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
111 int matchToSymbols(
QgsStyle *style );
114 void changeCategorizedSymbol();
115 void categoryColumnChanged(
const QString &field );
116 void categoriesDoubleClicked(
const QModelIndex &idx );
118 void addCategories();
123 void applyColorRamp();
125 void deleteCategories();
126 void deleteAllCategories();
128 void showSymbolLevels();
139 void matchToSymbolsFromLibrary();
148 void matchToSymbolsFromXml();
153 void updateSymbolsFromWidget();
154 void dataDefinedSizeLegend();
158 void updateUiFromRenderer();
160 void updateCategorizedSymbolIcon();
163 void populateCategories();
166 int currentCategoryRow();
169 QList<int> selectedCategories();
172 void changeSelectedSymbols();
174 void changeCategorySymbol();
176 QList<QgsSymbol *> selectedSymbols()
override;
178 void refreshSymbolView()
override;
179 void keyPressEvent( QKeyEvent *event )
override;
186 QgsCategorizedSymbolRendererModel *mModel =
nullptr;
189 QString mOldClassificationAttribute;
195 #endif // QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H
QList< QgsRendererCategory > QgsCategoryList
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract interface for generating an expression context.
Represents a vector layer which manages a vector based data sets.