17 #ifndef QGSATTRIBUTETABLEFILTERMODEL_H
18 #define QGSATTRIBUTETABLEFILTERMODEL_H
20 #include <QSortFilterProxyModel>
21 #include <QModelIndex>
29 class QItemSelectionModel;
60 ColumnTypeActionButton
99 void setSelectedOnTop(
bool selectedOnTop );
106 bool selectedOnTop();
114 virtual void setFilteredFeatures(
const QgsFeatureIds &ids );
128 void setFilterMode( FilterMode filterMode );
133 void disconnectFilterModeConnections();
138 void connectFilterModeConnections( FilterMode filterMode );
179 inline QModelIndex
mapToMaster(
const QModelIndex &proxyIndex )
const {
return mapToSource( proxyIndex ); }
181 inline QModelIndex
mapFromMaster(
const QModelIndex &sourceIndex )
const {
return mapFromSource( sourceIndex ); }
183 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
185 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
187 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
196 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
205 void sort(
const QString &expression, Qt::SortOrder order = Qt::AscendingOrder );
210 QString sortExpression()
const;
215 QVariant data(
const QModelIndex &index,
int role )
const override;
217 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
223 int actionColumnIndex()
const;
225 int columnCount(
const QModelIndex &parent )
const override;
269 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
275 void generateListOfVisibleFeatures();
281 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
291 Q_DECL_DEPRECATED
void extentsChanged();
299 void filterFeatures();
302 void selectionChanged();
303 void onColumnsChanged();
304 void reloadVisible();
305 void onAttributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
306 void onGeometryChanged();
312 bool mSelectedOnTop =
false;
316 QVector<int> mColumnMapping;
320 int mapColumnToSource(
int column )
const;
321 int mapColumnFromSource(
int column )
const;
323 QTimer mReloadVisibleTimer;
324 QTimer mFilterFeaturesTimer;
325 void startTimedReloadVisible();
326 void startTimedFilterFeatures();