15 #ifndef QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H 16 #define QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H 22 #include <QStandardItem> 28 #include "ui_qgscategorizedsymbolrendererv2widget.h" 35 class GUI_EXPORT QgsCategorizedSymbolRendererModel :
public QAbstractItemModel
39 QgsCategorizedSymbolRendererModel( QObject *parent =
nullptr );
40 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
41 Qt::DropActions supportedDropActions()
const override;
42 QVariant data(
const QModelIndex &index,
int role )
const override;
43 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
44 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
45 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
46 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
47 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
48 QModelIndex parent(
const QModelIndex &index )
const override;
49 QStringList mimeTypes()
const override;
50 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
51 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
57 void deleteRows( QList<int> rows );
59 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
60 void updateSymbology();
74 class QgsCategorizedSymbolRendererViewStyle:
public QgsProxyStyle 79 explicit QgsCategorizedSymbolRendererViewStyle( QWidget *parent );
81 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
112 int matchToSymbols(
QgsStyle *style );
115 void changeCategorizedSymbol();
116 void categoryColumnChanged(
const QString &field );
117 void categoriesDoubleClicked(
const QModelIndex &idx );
119 void addCategories();
124 void applyColorRamp();
126 void deleteCategories();
127 void deleteAllCategories();
129 void showSymbolLevels();
140 void matchToSymbolsFromLibrary();
149 void matchToSymbolsFromXml();
154 void updateSymbolsFromWidget();
155 void dataDefinedSizeLegend();
159 void updateUiFromRenderer();
161 void updateCategorizedSymbolIcon();
164 void populateCategories();
167 int currentCategoryRow();
170 QList<int> selectedCategories();
173 void changeSelectedSymbols();
175 void changeCategorySymbol();
177 void applyChangeToSymbol();
179 QList<QgsSymbol *> selectedSymbols()
override;
181 void refreshSymbolView()
override;
182 void keyPressEvent( QKeyEvent *event )
override;
185 std::unique_ptr< QgsCategorizedSymbolRenderer >
mRenderer;
189 QgsCategorizedSymbolRendererModel *mModel =
nullptr;
192 QString mOldClassificationAttribute;
198 #endif // QGSCATEGORIZEDSYMBOLRENDERERV2WIDGET_H
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style...
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.