16 #ifndef QGSRULEBASEDRENDERERWIDGET_H
17 #define QGSRULEBASEDRENDERERWIDGET_H
28 #include <QAbstractItemModel>
58 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
59 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole )
const override;
60 QVariant headerData(
int section, Qt::Orientation orientation,
61 int role = Qt::DisplayRole )
const override;
62 int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
63 int columnCount(
const QModelIndex & = QModelIndex() )
const override;
64 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex() )
const override;
65 QModelIndex parent(
const QModelIndex &index )
const override;
68 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole )
override;
71 Qt::DropActions supportedDropActions()
const override;
72 QStringList mimeTypes()
const override;
73 QMimeData *mimeData(
const QModelIndexList &indexes )
const override;
74 bool dropMimeData(
const QMimeData *data, Qt::DropAction action,
int row,
int column,
const QModelIndex &parent )
override;
76 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
83 void updateRule(
const QModelIndex &parent,
int row );
85 void updateRule(
const QModelIndex &index );
86 void removeRule(
const QModelIndex &index );
96 void willAddRules(
const QModelIndex &parent,
int count );
97 void finishedAddingRules();
100 void setFeatureCounts(
const QHash<QgsRuleBasedRenderer::Rule *, QgsRuleBasedRendererCount> &countMap )
SIP_SKIP;
101 void clearFeatureCounts();
111 #include "ui_qgsrulebasedrendererwidget.h"
129 void setDockMode(
bool dockMode )
override;
135 void editRule(
const QModelIndex &index );
137 void countFeatures();
140 void refineRuleScales();
141 void refineRuleCategories();
142 void refineRuleRanges();
144 void setRenderingOrder();
146 void currentRuleChanged(
const QModelIndex ¤t = QModelIndex(),
const QModelIndex &previous = QModelIndex() );
147 void selectedRulesChanged();
149 void saveSectionWidth(
int section,
int oldSize,
int newSize );
150 void restoreSectionWidths();
153 void refineRule(
int type );
155 void refineRuleCategoriesGui();
157 void refineRuleRangesGui();
158 void refineRuleScalesGui(
const QModelIndexList &index );
160 void setSymbolLevels(
const QList< QgsLegendSymbolItem > &levels,
bool enabled )
override;
164 QList<QgsSymbol *> selectedSymbols()
override;
166 void refreshSymbolView()
override;
167 void keyPressEvent( QKeyEvent *event )
override;
172 QMenu *mRefineMenu =
nullptr;
173 QAction *mDeleteAction =
nullptr;
176 QMenu *mContextMenu =
nullptr;
179 void copy()
override;
180 void paste()
override;
181 void pasteSymbolToSelection()
override;
187 void liveUpdateRuleFromPanel();
188 void showContextMenu( QPoint p );
195 #include "ui_qgsrendererrulepropsdialogbase.h"
196 #include "qgis_gui.h"
238 void buildExpression();
249 void setDockMode(
bool dockMode )
override;
285 void buildExpression();
286 void accept()
override;
293 QDialogButtonBox *buttonBox =
nullptr;
QgsRuleBasedRenderer::Rule * rule()
Tree model for the rules:
QHash< QgsRuleBasedRenderer::Rule *, QgsRuleBasedRendererCount > mFeatureCountMap
This class keeps data about a rules for rule-based renderer.
QList< QgsRuleBasedRenderer::Rule * > RuleList
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 data sets.
QHash< QgsRuleBasedRenderer::Rule *, int > duplicateCountMap