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;
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 );
170 QMenu *mRefineMenu =
nullptr;
171 QAction *mDeleteAction =
nullptr;
174 QMenu *mContextMenu =
nullptr;
177 void copy()
override;
178 void paste()
override;
185 void liveUpdateRuleFromPanel();
186 void showContextMenu( QPoint p );
193 #include "ui_qgsrendererrulepropsdialogbase.h"
194 #include "qgis_gui.h"
200 class GUI_EXPORT QgsRendererRulePropsWidget :
public QgsPanelWidget,
private Ui::QgsRendererRulePropsWidget
236 void buildExpression();
283 void buildExpression();
284 void accept()
override;
290 QgsRendererRulePropsWidget *mPropsWidget =
nullptr;
291 QDialogButtonBox *buttonBox =
nullptr;
295 #endif // QGSRULEBASEDRENDERERWIDGET_H