15#ifndef QGSCATEGORIZEDSYMBOLRENDERERWIDGET_H
16#define QGSCATEGORIZEDSYMBOLRENDERERWIDGET_H
24#include <QStandardItem>
25#include <QStyledItemDelegate>
31#include "ui_qgscategorizedsymbolrendererwidget.h"
38class GUI_EXPORT QgsCategorizedSymbolRendererModel :
public QgsTemplatedCategorizedRendererModel<QgsCategorizedSymbolRenderer>
42 QgsCategorizedSymbolRendererModel( QObject *parent =
nullptr, QScreen *screen =
nullptr );
44 Qt::ItemFlags extraFlags(
const QModelIndex &index )
const override;
46 bool setExtraData(
const QModelIndex &index,
const QVariant &value )
override;
47 QVariant extraData(
const QModelIndex &index,
int role )
const override;
48 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
49 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
50 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
56 void onRowsMoved()
override;
63class GUI_EXPORT QgsCategorizedSymbolRendererViewStyle :
public QgsProxyStyle
68 explicit QgsCategorizedSymbolRendererViewStyle( QWidget *parent );
70 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
77class GUI_EXPORT QgsCategorizedRendererViewItemDelegate :
public QStyledItemDelegate
82 explicit QgsCategorizedRendererViewItemDelegate( QgsFieldExpressionWidget *expressionWidget, QObject *parent =
nullptr );
85 QWidget *createEditor( QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index )
const override;
88 QgsFieldExpressionWidget *mFieldExpressionWidget =
nullptr;
127 void disableSymbolLevels() override
SIP_SKIP;
138 int matchToSymbols(
QgsStyle *style );
141 void changeCategorizedSymbol();
142 void categoryColumnChanged( const QString &field );
143 void categoriesDoubleClicked( const QModelIndex &idx );
145 void addCategories();
150 void applyColorRamp();
152 void deleteCategories();
153 void deleteAllCategories();
158 void deleteUnusedCategories();
160 void showSymbolLevels();
170 void matchToSymbolsFromLibrary();
178 void matchToSymbolsFromXml();
185 void pasteSymbolToSelection() override;
190 void updateSymbolsFromButton();
191 void dataDefinedSizeLegend();
198 void mergeSelectedCategories();
205 void unmergeSelectedCategories();
207 void showContextMenu( QPoint p );
209 void selectionChanged( const QItemSelection &selected, const QItemSelection &deselected );
212 void updateUiFromRenderer();
215 void populateCategories();
218 int currentCategoryRow();
221 QList<
int> selectedCategories();
224 void changeSelectedSymbols();
226 void changeCategorySymbol();
228 void applyChangeToSymbol();
237 Q_DECL_DEPRECATED QList<QVariant> layerUniqueValues( const QString &attrName )
SIP_DEPRECATED;
239 QList<
QgsSymbol *> selectedSymbols() override;
241 void refreshSymbolView() override;
242 void keyPressEvent( QKeyEvent *event ) override;
249 QgsCategorizedSymbolRendererModel *
mModel =
nullptr;
252 QString mOldClassificationAttribute;
254 QMenu *mContextMenu =
nullptr;
255 QAction *mMergeCategoriesAction =
nullptr;
256 QAction *mUnmergeCategoriesAction =
nullptr;
257 QAction *mActionLevels =
nullptr;
A feature renderer which represents features using a list of renderer categories.
QgsRendererCategory Category
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract base class for all 2D vector feature renderers.
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style,...
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
A database of saved style entities, including symbols, color ramps, text formats and others.
Contains settings which reflect the context in which a symbol (or renderer) widget is shown,...
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based dataset.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
QList< QgsRendererCategory > QgsCategoryList
QList< QgsLegendSymbolItem > QgsLegendSymbolList