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" 117 class GUI_EXPORT QgsRuleBasedRendererWidget :
public QgsRendererWidget,
private Ui::QgsRuleBasedRendererWidget
126 ~QgsRuleBasedRendererWidget()
override;
134 void editRule(
const QModelIndex &index );
136 void countFeatures();
139 void refineRuleScales();
140 void refineRuleCategories();
141 void refineRuleRanges();
143 void setRenderingOrder();
145 void currentRuleChanged(
const QModelIndex ¤t = QModelIndex(),
const QModelIndex &previous = QModelIndex() );
146 void selectedRulesChanged();
148 void saveSectionWidth(
int section,
int oldSize,
int newSize );
149 void restoreSectionWidths();
152 void refineRule(
int type );
154 void refineRuleCategoriesGui();
156 void refineRuleRangesGui();
157 void refineRuleScalesGui(
const QModelIndexList &index );
161 QList<QgsSymbol *> selectedSymbols()
override;
163 void refreshSymbolView()
override;
164 void keyPressEvent( QKeyEvent *event )
override;
169 QMenu *mRefineMenu =
nullptr;
170 QAction *mDeleteAction =
nullptr;
173 QMenu *mContextMenu =
nullptr;
176 void copy()
override;
177 void paste()
override;
178 void pasteSymbolToSelection()
override;
184 void liveUpdateRuleFromPanel();
185 void showContextMenu( QPoint p );
192 #include "ui_qgsrendererrulepropsdialogbase.h" 193 #include "qgis_gui.h" 199 class GUI_EXPORT QgsRendererRulePropsWidget :
public QgsPanelWidget,
private Ui::QgsRendererRulePropsWidget
235 void buildExpression();
246 void setDockMode(
bool dockMode )
override;
282 void buildExpression();
283 void accept()
override;
289 QgsRendererRulePropsWidget *mPropsWidget =
nullptr;
290 QDialogButtonBox *buttonBox =
nullptr;
294 #endif // QGSRULEBASEDRENDERERWIDGET_H
Tree model for the rules:
Abstract base class for all rendered symbols.
This class keeps data about a rules for rule-based renderer.
QList< QgsRuleBasedRenderer::Rule * > RuleList
QgsRuleBasedRenderer::Rule * rule()
QHash< QgsRuleBasedRenderer::Rule *, int > duplicateCountMap
Contains settings which reflect the context in which a symbol (or renderer) widget is shown...
When drawing a vector layer with rule-based renderer, it goes through the rules and draws features wi...
QHash< QgsRuleBasedRenderer::Rule *, QgsRuleBasedRendererCount > mFeatureCountMap
Represents a vector layer which manages a vector based data sets.