16#ifndef QGSGRADUATEDSYMBOLRENDERERWIDGET_H
17#define QGSGRADUATEDSYMBOLRENDERERWIDGET_H
19#include <QStandardItem>
30#include "ui_qgsgraduatedsymbolrendererwidget.h"
39class GUI_EXPORT QgsGraduatedSymbolRendererModel :
public QAbstractItemModel
43 QgsGraduatedSymbolRendererModel( QObject *parent =
nullptr, QScreen *screen =
nullptr );
44 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
45 Qt::DropActions supportedDropActions()
const override;
46 QVariant data(
const QModelIndex &index,
int role )
const override;
47 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
48 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
49 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
50 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
51 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
52 QModelIndex parent(
const QModelIndex &index )
const override;
53 QStringList mimeTypes()
const override;
54 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
55 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
62 void deleteRows( QList<int> rows );
64 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
65 void updateSymbology();
74 QPointer<QScreen> mScreen;
78class QgsGraduatedSymbolRendererViewStyle :
public QgsProxyStyle
83 explicit QgsGraduatedSymbolRendererViewStyle( QWidget *parent );
85 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
108 void disableSymbolLevels()
override SIP_SKIP;
112 void graduatedColumnChanged(
const QString &field );
113 void classifyGraduated();
114 void reapplyColorRamp();
116 void rangesDoubleClicked(
const QModelIndex &idx );
117 void rangesClicked(
const QModelIndex &idx );
118 void changeCurrentValue( QStandardItem *item );
123 void deleteClasses();
125 void deleteAllClasses();
127 void toggleBoundariesLink(
bool linked );
129 void labelFormatChanged();
131 void showSymbolLevels();
134 void modelDataChanged();
141 void refreshRanges(
bool reset );
147 void mSizeUnitWidget_changed();
148 void methodComboBox_currentIndexChanged(
int );
149 void updateMethodParameters();
151 void dataDefinedSizeLegend();
152 void changeGraduatedSymbol();
153 void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected );
154 void symmetryPointEditingFinished();
155 void classifyGraduatedImpl();
159 void pasteSymbolToSelection()
override;
162 void updateUiFromRenderer(
bool updateCount =
true );
163 void connectUpdateHandlers();
164 void disconnectUpdateHandlers();
168 QList<int> selectedClasses();
171 void changeRangeSymbol(
int rangeIdx );
172 void changeRange(
int rangeIdx );
174 void changeSelectedSymbols();
176 void applyChangeToSymbol();
178 QList<QgsSymbol *> selectedSymbols()
override;
179 QgsSymbol *findSymbolForRange(
double lowerBound,
double upperBound,
const QgsRangeList &ranges )
const;
180 void refreshSymbolView()
override;
182 void keyPressEvent( QKeyEvent *event )
override;
191 void toggleMethodWidgets( MethodMode mode );
193 void clearParameterWidgets();
195 std::unique_ptr<QgsGraduatedSymbolRenderer> mRenderer;
197 std::unique_ptr<QgsSymbol> mGraduatedSymbol;
201 QgsGraduatedSymbolRendererModel *mModel =
nullptr;
206 QAction *mActionLevels =
nullptr;
208 std::unique_ptr< QgsClassificationMethod > mClassificationMethod;
209 std::vector<std::unique_ptr<QgsAbstractProcessingParameterWidgetWrapper>> mParameterWidgetWrappers;
211 int mBlockUpdates = 0;
A custom validator which allows entry of doubles in a locale-tolerant way.
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 vector feature renderer which uses numeric attributes to classify features into different ranges.
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style,...
Represents a value range for a QgsGraduatedSymbolRenderer.
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.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
QList< QgsRendererRange > QgsRangeList