17 #ifndef QGSATTRIBUTETABLEFILTERMODEL_H
18 #define QGSATTRIBUTETABLEFILTERMODEL_H
20 #include <QSortFilterProxyModel>
21 #include <QModelIndex>
30 class QItemSelectionModel;
61 ColumnTypeActionButton
86 #pragma clang diagnostic push
87 #pragma clang diagnostic ignored "-Woverloaded-virtual"
100 #pragma clang diagnostic pop
109 void setSelectedOnTop(
bool selectedOnTop );
116 bool selectedOnTop();
124 virtual void setFilteredFeatures(
const QgsFeatureIds &ids );
138 void setFilterMode( FilterMode filterMode );
143 void disconnectFilterModeConnections();
148 void connectFilterModeConnections( FilterMode filterMode );
189 inline QModelIndex
mapToMaster(
const QModelIndex &proxyIndex )
const {
return mapToSource( proxyIndex ); }
191 inline QModelIndex
mapFromMaster(
const QModelIndex &sourceIndex )
const {
return mapFromSource( sourceIndex ); }
193 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
195 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
197 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
206 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
215 void sort(
const QString &expression, Qt::SortOrder order = Qt::AscendingOrder );
220 QString sortExpression()
const;
225 QVariant data(
const QModelIndex &index,
int role )
const override;
227 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
233 int actionColumnIndex()
const;
235 int columnCount(
const QModelIndex &parent )
const override;
261 void sortColumnChanged(
int column, Qt::SortOrder order );
266 void featuresFiltered();
271 void visibleReloaded();
277 void filterError(
const QString &errorMessage );
287 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
293 void generateListOfVisibleFeatures();
299 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
309 Q_DECL_DEPRECATED
void extentsChanged();
317 void filterFeatures();
320 void selectionChanged();
321 void onColumnsChanged();
322 void reloadVisible();
323 void onAttributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
324 void onGeometryChanged();
329 FilterMode mFilterMode = FilterMode::ShowAll;
330 bool mSelectedOnTop =
false;
334 QVector<int> mColumnMapping;
338 int mapColumnToSource(
int column )
const;
339 int mapColumnFromSource(
int column )
const;
341 QTimer mReloadVisibleTimer;
342 QTimer mFilterFeaturesTimer;
343 void startTimedReloadVisible();
344 void startTimedFilterFeatures();