15 #ifndef QGSCATEGORIZEDSYMBOLRENDERERWIDGET_H
16 #define QGSCATEGORIZEDSYMBOLRENDERERWIDGET_H
22 #include <QStandardItem>
28 #include "ui_qgscategorizedsymbolrendererwidget.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;
103 void disableSymbolLevels()
override SIP_SKIP;
114 int matchToSymbols(
QgsStyle *style );
117 void changeCategorizedSymbol();
118 void categoryColumnChanged(
const QString &
field );
119 void categoriesDoubleClicked(
const QModelIndex &idx );
121 void addCategories();
126 void applyColorRamp();
128 void deleteCategories();
129 void deleteAllCategories();
131 void showSymbolLevels();
142 void matchToSymbolsFromLibrary();
151 void matchToSymbolsFromXml();
158 void pasteSymbolToSelection()
override;
163 void updateSymbolsFromWidget();
164 void updateSymbolsFromButton();
165 void dataDefinedSizeLegend();
172 void mergeSelectedCategories();
179 void unmergeSelectedCategories();
181 void showContextMenu( QPoint p );
183 void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected );
187 void updateUiFromRenderer();
190 void populateCategories();
193 int currentCategoryRow();
196 QList<int> selectedCategories();
199 void changeSelectedSymbols();
201 void changeCategorySymbol();
203 void applyChangeToSymbol();
205 QList<QgsSymbol *> selectedSymbols()
override;
207 void refreshSymbolView()
override;
208 void keyPressEvent( QKeyEvent *event )
override;
211 std::unique_ptr< QgsCategorizedSymbolRenderer >
mRenderer;
215 QgsCategorizedSymbolRendererModel *mModel =
nullptr;
218 QString mOldClassificationAttribute;
220 QMenu *mContextMenu =
nullptr;
221 QAction *mMergeCategoriesAction =
nullptr;
222 QAction *mUnmergeCategoriesAction =
nullptr;
223 QAction *mActionLevels =
nullptr;
227 friend class TestQgsCategorizedRendererWidget;
Abstract interface for generating an expression context.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style,...
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Represents a vector layer which manages a vector based data sets.
QList< QgsRendererCategory > QgsCategoryList
QList< QgsLegendSymbolItem > QgsLegendSymbolList