17#ifndef QGSATTRIBUTETABLEFILTERMODEL_H
18#define QGSATTRIBUTETABLEFILTERMODEL_H
20#include <QSortFilterProxyModel>
30class QItemSelectionModel;
62 ColumnTypeActionButton
92#pragma clang diagnostic push
93#pragma clang diagnostic ignored "-Woverloaded-virtual"
105#pragma clang diagnostic pop
114 void setSelectedOnTop(
bool selectedOnTop );
121 bool selectedOnTop();
129 virtual void setFilteredFeatures(
const QgsFeatureIds &ids );
143 void setFilterMode( FilterMode filterMode );
148 void disconnectFilterModeConnections();
153 void connectFilterModeConnections( FilterMode filterMode );
194 QModelIndex mapToMaster(
const QModelIndex &proxyIndex )
const;
196 inline QModelIndex
mapFromMaster(
const QModelIndex &sourceIndex )
const {
return mapFromSource( sourceIndex ); }
198 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
200 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
202 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
211 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
220 void sort(
const QString &expression, Qt::SortOrder order = Qt::AscendingOrder );
225 QString sortExpression()
const;
230 QVariant data(
const QModelIndex &index,
int role )
const override;
232 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
238 int actionColumnIndex()
const;
240 int columnCount(
const QModelIndex &parent )
const override;
299 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
305 void generateListOfVisibleFeatures();
311 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
321 Q_DECL_DEPRECATED
void extentsChanged();
329 void filterFeatures();
332 void selectionChanged();
333 void onColumnsChanged();
334 void reloadVisible();
335 void onAttributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
336 void onGeometryChanged();
342 bool mSelectedOnTop =
false;
346 QVector<int> mColumnMapping;
350 int mapColumnToSource(
int column )
const;
351 int mapColumnFromSource(
int column )
const;
353 QTimer mReloadVisibleTimer;
354 QTimer mFilterFeaturesTimer;
355 void startTimedReloadVisible();
356 void startTimedFilterFeatures();
This is a container for configuration of the attribute table.
FilterMode filterMode()
The current filterModel.
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.
CustomRole
The additional roles defined by this filter model.
FilterMode
The filter mode defines how the rows should be filtered.
@ ShowFilteredList
Show only features whose ids are on the filter list. {.
@ ShowVisible
Show only visible features (depends on the map canvas)
@ ShowSelected
Show only selected features.
@ ShowInvalid
Show only features not respecting constraints (since QGIS 3.30)
@ ShowEdited
Show only features which have unsaved changes.
@ ShowAll
Show all features.
void filterError(const QString &errorMessage)
Emitted when an error occurred while filtering features.
QModelIndex mapFromMaster(const QModelIndex &sourceIndex) const
QgsAttributeTableModel * masterModel() const
Returns the table model this filter is using.
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.
@ 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...
Class for parsing and evaluation of expressions (formerly called "search strings").
virtual QModelIndex fidToIndex(QgsFeatureId fid)=0
Map canvas is a class for displaying all GIS data types on a canvas.
This class caches features of a given QgsVectorLayer.
Represents a vector layer which manages a vector based data sets.
#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