16 #ifndef QGSGRADUATEDSYMBOLRENDERERWIDGET_H 17 #define QGSGRADUATEDSYMBOLRENDERERWIDGET_H 23 #include <QStandardItem> 25 #include "ui_qgsgraduatedsymbolrendererwidget.h" 31 class GUI_EXPORT QgsGraduatedSymbolRendererModel :
public QAbstractItemModel
35 QgsGraduatedSymbolRendererModel( QObject *parent =
nullptr );
36 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
37 Qt::DropActions supportedDropActions()
const override;
38 QVariant data(
const QModelIndex &index,
int role )
const override;
39 bool setData(
const QModelIndex &index,
const QVariant &value,
int role )
override;
40 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
41 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
42 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
43 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
44 QModelIndex parent(
const QModelIndex &index )
const override;
45 QStringList mimeTypes()
const override;
46 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
47 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
54 void deleteRows( QList<int> rows );
56 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
57 void updateSymbology(
bool resetModel =
false );
69 class QgsGraduatedSymbolRendererViewStyle:
public QgsProxyStyle 74 explicit QgsGraduatedSymbolRendererViewStyle( QWidget *parent );
76 void drawPrimitive( PrimitiveElement element,
const QStyleOption *option, QPainter *painter,
const QWidget *widget =
nullptr )
const override;
99 void changeGraduatedSymbol();
100 void graduatedColumnChanged(
const QString &field );
101 void classifyGraduated();
102 void reapplyColorRamp();
104 void rangesDoubleClicked(
const QModelIndex &idx );
105 void rangesClicked(
const QModelIndex &idx );
106 void changeCurrentValue( QStandardItem *item );
111 void deleteClasses();
113 void deleteAllClasses();
115 void toggleBoundariesLink(
bool linked );
117 void labelFormatChanged();
119 void showSymbolLevels();
122 void modelDataChanged();
123 void refreshRanges(
bool reset =
false );
126 void mSizeUnitWidget_changed();
127 void methodComboBox_currentIndexChanged(
int );
129 void updateSymbolsFromWidget();
130 void toggleMethodWidgets(
int idx );
131 void dataDefinedSizeLegend();
134 void updateUiFromRenderer(
bool updateCount =
true );
135 void connectUpdateHandlers();
136 void disconnectUpdateHandlers();
139 void updateGraduatedSymbolIcon();
142 QList<int> selectedClasses();
145 void changeRangeSymbol(
int rangeIdx );
146 void changeRange(
int rangeIdx );
148 void changeSelectedSymbols();
150 void applyChangeToSymbol();
152 QList<QgsSymbol *> selectedSymbols()
override;
153 QgsSymbol *findSymbolForRange(
double lowerBound,
double upperBound,
const QgsRangeList &ranges )
const;
154 void refreshSymbolView()
override;
156 void keyPressEvent( QKeyEvent *event )
override;
159 std::unique_ptr< QgsGraduatedSymbolRenderer > mRenderer;
161 std::unique_ptr< QgsSymbol > mGraduatedSymbol;
165 QgsGraduatedSymbolRendererModel *mModel =
nullptr;
173 #endif // QGSGRADUATEDSYMBOLRENDERERWIDGET_H Abstract base class for all rendered symbols.
QList< QgsRendererRange > QgsRangeList
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Abstract interface for generating an expression context.
Represents a vector layer which manages a vector based data sets.