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;
94 ~QgsGraduatedSymbolRendererWidget()
override;
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 dataDefinedSizeLegend();
131 void changeGraduatedSymbol();
132 void selectionChanged(
const QItemSelection &selected,
const QItemSelection &deselected );
133 void symmetryPointEditingFinished();
137 void pasteSymbolToSelection()
override;
140 void updateUiFromRenderer(
bool updateCount =
true );
141 void connectUpdateHandlers();
142 void disconnectUpdateHandlers();
146 QList<int> selectedClasses();
149 void changeRangeSymbol(
int rangeIdx );
150 void changeRange(
int rangeIdx );
152 void changeSelectedSymbols();
154 void applyChangeToSymbol();
156 QList<QgsSymbol *> selectedSymbols()
override;
157 QgsSymbol *findSymbolForRange(
double lowerBound,
double upperBound,
const QgsRangeList &ranges )
const;
158 void refreshSymbolView()
override;
160 void keyPressEvent( QKeyEvent *event )
override;
170 void toggleMethodWidgets( MethodMode mode );
172 std::unique_ptr< QgsGraduatedSymbolRenderer > mRenderer;
174 std::unique_ptr< QgsSymbol > mGraduatedSymbol;
178 QgsGraduatedSymbolRendererModel *mModel =
nullptr;
182 QDoubleValidator *mSymmetryPointValidator;
186 #endif // QGSGRADUATEDSYMBOLRENDERERWIDGET_H QList< QgsRendererRange > QgsRangeList
Abstract base class for all rendered symbols.
A QProxyStyle subclass which correctly sets the base style to match the QGIS application style...
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
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.