17#ifndef QGSATTRIBUTETABLEFILTERMODEL_H
18#define QGSATTRIBUTETABLEFILTERMODEL_H
26#include <QSortFilterProxyModel>
31class QItemSelectionModel;
79#pragma clang diagnostic push
80#pragma clang diagnostic ignored "-Woverloaded-virtual"
92#pragma clang diagnostic pop
101 void setSelectedOnTop(
bool selectedOnTop );
108 bool selectedOnTop();
116 virtual void setFilteredFeatures(
const QgsFeatureIds &ids );
135 void disconnectFilterModeConnections();
181 QModelIndex mapToMaster(
const QModelIndex &proxyIndex )
const;
185 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
187 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
189 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
198 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
207 void sort(
const QString &expression, Qt::SortOrder order = Qt::AscendingOrder );
212 QString sortExpression()
const;
217 QVariant data(
const QModelIndex &index,
int role )
const override;
219 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
225 int actionColumnIndex()
const;
227 int columnCount(
const QModelIndex &parent )
const override;
285 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
297 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
318 void selectionChanged();
319 void onColumnsChanged();
320 void reloadVisible();
321 void onAttributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
322 void onGeometryChanged();
328 bool mSelectedOnTop =
false;
332 QVector<int> mColumnMapping;
336 int mapColumnToSource(
int column )
const;
337 int mapColumnFromSource(
int column )
const;
339 QTimer mReloadVisibleTimer;
340 QTimer mFilterFeaturesTimer;
341 void startTimedReloadVisible();
342 void startTimedFilterFeatures();
AttributeTableFilterMode
Defines how rows in attribute tables should be filtered.
@ ShowAll
Show all features.
A container for configuration of the attribute table.
A proxy model for filtering an attribute table model.
QModelIndex mapFromSource(const QModelIndex &sourceIndex) const override
Q_DECL_DEPRECATED void extentsChanged()
Is called upon every change of the visible extents on the map canvas.
QgsAttributeTableFilterModel(QgsMapCanvas *canvas, QgsAttributeTableModel *sourceModel, QObject *parent=nullptr)
Make sure, the master model is already loaded, so the selection will get synchronized.
QgsMapCanvas * mapCanvas() const
Returns the map canvas.
QgsVectorLayerCache * layerCache() const
Returns the layerCache this filter acts on.
QString filterExpression() const
Returns the stored filter expression string.
void generateListOfVisibleFeatures()
Updates the list of currently visible features on the map canvas.
CustomRole
The additional roles defined by this filter model.
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override
Used by the sorting algorithm.
void filterError(const QString &errorMessage)
Emitted when an error occurred while filtering features.
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override
Returns true if the source row will be accepted.
QModelIndex mapFromMaster(const QModelIndex &sourceIndex) const
void filterFeatures()
Updates the filtered features in the filter model.
QgsAttributeTableModel * masterModel() const
Returns the table model this filter is using.
Qgis::AttributeTableFilterMode filterMode()
The current filterModel.
void featuresFiltered()
Emitted when the filtering of the features has been done.
void visibleReloaded()
Emitted when the the visible features on extend are reloaded (the list is created).
ColumnType
The type of a column.
@ ColumnTypeActionButton
This column shows action buttons.
@ ColumnTypeField
This column shows a field.
QgsVectorLayer * layer() const
Returns the layer this filter acts on.
void sortColumnChanged(int column, Qt::SortOrder order)
Emitted whenever the sort column is changed.
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
@ User
Start further roles starting from this role.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Handles parsing and evaluation of expressions (formerly called "search strings").
Base class for feature models.
virtual QModelIndex fidToIndex(QgsFeatureId fid)=0
Map canvas is a class for displaying all GIS data types on a canvas.
Caches features for a given QgsVectorLayer.
Represents a vector layer which manages a vector based dataset.
#define SIP_MONKEYPATCH_SCOPEENUM_UNNEST(OUTSIDE_CLASS, FORMERNAME)
#define SIP_MONKEYPATCH_COMPAT_NAME(FORMERNAME)
QSet< QgsFeatureId > QgsFeatureIds
qint64 QgsFeatureId
64 bit feature ids negative numbers are used for uncommitted/newly added features