16 #ifndef QGSGRADUATEDSYMBOLRENDERERWIDGET_H
17 #define QGSGRADUATEDSYMBOLRENDERERWIDGET_H
19 #include <QStandardItem>
28 #include "ui_qgsgraduatedsymbolrendererwidget.h"
36 class GUI_EXPORT QgsGraduatedSymbolRendererModel :
public QAbstractItemModel
40 QgsGraduatedSymbolRendererModel( QObject *parent =
nullptr );
41 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
42 Qt::DropActions supportedDropActions()
const override;
43 QVariant data(
const QModelIndex &index,
int role )
const override;
44 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
45 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
46 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
47 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
48 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
49 QModelIndex parent(
const QModelIndex &index )
const override;
50 QStringList mimeTypes()
const override;
51 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
52 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
59 void deleteRows( QList<int> rows );
61 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
62 void updateSymbology();
74 class QgsGraduatedSymbolRendererViewStyle:
public QgsProxyStyle
79 explicit QgsGraduatedSymbolRendererViewStyle( QWidget *parent );
81 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
99 ~QgsGraduatedSymbolRendererWidget()
override;
105 void graduatedColumnChanged(
const QString &
field );
106 void classifyGraduated();
107 void reapplyColorRamp();
109 void rangesDoubleClicked(
const QModelIndex &idx );
110 void rangesClicked(
const QModelIndex &idx );
111 void changeCurrentValue( QStandardItem *item );
116 void deleteClasses();
118 void deleteAllClasses();
120 void toggleBoundariesLink(
bool linked );
122 void labelFormatChanged();
124 void showSymbolLevels();
127 void modelDataChanged();
134 void refreshRanges(
bool reset );
137 void mSizeUnitWidget_changed();
138 void methodComboBox_currentIndexChanged(
int );
139 void updateMethodParameters();
141 void updateSymbolsFromWidget();
142 void dataDefinedSizeLegend();
143 void changeGraduatedSymbol();
144 void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected );
145 void symmetryPointEditingFinished();
152 void updateUiFromRenderer(
bool updateCount =
true );
153 void connectUpdateHandlers();
154 void disconnectUpdateHandlers();
158 QList<int> selectedClasses();
161 void changeRangeSymbol(
int rangeIdx );
162 void changeRange(
int rangeIdx );
164 void changeSelectedSymbols();
166 void applyChangeToSymbol();
169 QgsSymbol *findSymbolForRange(
double lowerBound,
double upperBound,
const QgsRangeList &ranges )
const;
182 void toggleMethodWidgets( MethodMode mode );
184 void clearParameterWidgets();
186 std::unique_ptr< QgsGraduatedSymbolRenderer > mRenderer;
188 std::unique_ptr< QgsSymbol > mGraduatedSymbol;
192 QgsGraduatedSymbolRendererModel *mModel =
nullptr;
196 QDoubleValidator *mSymmetryPointValidator;
198 std::vector< std::unique_ptr< QgsAbstractProcessingParameterWidgetWrapper >> mParameterWidgetWrappers;
202 #endif // QGSGRADUATEDSYMBOLRENDERERWIDGET_H