16 #ifndef QGSGRADUATEDSYMBOLRENDERERWIDGET_H
17 #define QGSGRADUATEDSYMBOLRENDERERWIDGET_H
19 #include <QStandardItem>
29 #include "ui_qgsgraduatedsymbolrendererwidget.h"
37 class GUI_EXPORT QgsGraduatedSymbolRendererModel :
public QAbstractItemModel
41 QgsGraduatedSymbolRendererModel( QObject *parent =
nullptr );
42 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
43 Qt::DropActions supportedDropActions()
const override;
44 QVariant data(
const QModelIndex &index,
int role )
const override;
45 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
46 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
47 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
48 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
49 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
50 QModelIndex parent(
const QModelIndex &index )
const override;
51 QStringList mimeTypes()
const override;
52 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
53 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
60 void deleteRows( QList<int> rows );
62 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
63 void updateSymbology();
75 class QgsGraduatedSymbolRendererViewStyle:
public QgsProxyStyle
80 explicit QgsGraduatedSymbolRendererViewStyle( QWidget *parent );
82 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
100 ~QgsGraduatedSymbolRendererWidget()
override;
107 void graduatedColumnChanged(
const QString &
field );
108 void classifyGraduated();
109 void reapplyColorRamp();
111 void rangesDoubleClicked(
const QModelIndex &idx );
112 void rangesClicked(
const QModelIndex &idx );
113 void changeCurrentValue( QStandardItem *item );
118 void deleteClasses();
120 void deleteAllClasses();
122 void toggleBoundariesLink(
bool linked );
124 void labelFormatChanged();
126 void showSymbolLevels();
129 void modelDataChanged();
136 void refreshRanges(
bool reset );
142 void mSizeUnitWidget_changed();
143 void methodComboBox_currentIndexChanged(
int );
144 void updateMethodParameters();
146 void updateSymbolsFromWidget();
147 void dataDefinedSizeLegend();
148 void changeGraduatedSymbol();
149 void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected );
150 void symmetryPointEditingFinished();
157 void updateUiFromRenderer(
bool updateCount =
true );
158 void connectUpdateHandlers();
159 void disconnectUpdateHandlers();
163 QList<int> selectedClasses();
166 void changeRangeSymbol(
int rangeIdx );
167 void changeRange(
int rangeIdx );
169 void changeSelectedSymbols();
171 void applyChangeToSymbol();
174 QgsSymbol *findSymbolForRange(
double lowerBound,
double upperBound,
const QgsRangeList &ranges )
const;
187 void toggleMethodWidgets( MethodMode mode );
189 void clearParameterWidgets();
191 std::unique_ptr< QgsGraduatedSymbolRenderer > mRenderer;
193 std::unique_ptr< QgsSymbol > mGraduatedSymbol;
197 QgsGraduatedSymbolRendererModel *mModel =
nullptr;
202 QAction *mActionLevels =
nullptr;
203 std::vector< std::unique_ptr< QgsAbstractProcessingParameterWidgetWrapper >> mParameterWidgetWrappers;
205 int mBlockUpdates = 0;
209 #endif // QGSGRADUATEDSYMBOLRENDERERWIDGET_H