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 );
169 inline QModelIndex
mapToMaster(
const QModelIndex &proxyIndex )
const {
return mapToSource( proxyIndex ); }
171 inline QModelIndex
mapFromMaster(
const QModelIndex &sourceIndex )
const {
return mapFromSource( sourceIndex ); }
173 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
175 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
177 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
186 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
195 void sort(
const QString &expression, Qt::SortOrder order = Qt::AscendingOrder );
200 QString sortExpression()
const;
205 QVariant data(
const QModelIndex &index,
int role )
const override;
207 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
213 int actionColumnIndex()
const;
215 int columnCount(
const QModelIndex &parent )
const override;
231 void sortColumnChanged(
int column, Qt::SortOrder order );
241 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
247 void generateListOfVisibleFeatures();
253 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
261 void extentsChanged();
264 void selectionChanged();
265 void onColumnsChanged();
271 bool mSelectedOnTop =
false;
275 QVector<int> mColumnMapping;
276 int mapColumnToSource(
int column )
const;
277 int mapColumnFromSource(
int column )
const;
QgsVectorLayer * layer() const
Returns the layer this filter acts on.
QSet< QgsFeatureId > QgsFeatureIds
QgsAttributeTableModel * masterModel() const
Returns the table model this filter is using.
QModelIndex mapFromMaster(const QModelIndex &sourceIndex) const
Role
The additional roles defined by this filter model.
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
Show only visible features (depends on the map canvas)
Map canvas is a class for displaying all GIS data types on a canvas.
virtual QModelIndex fidToIndex(QgsFeatureId fid)=0
Show only selected features.
FilterMode filterMode()
The current filterModel.
FilterMode
The filter mode defines how the rows should be filtered.
This column shows a field.
This class caches features of a given QgsVectorLayer.
Show only features whose ids are on the filter list. {.
Start further roles starting from this role.
QgsMapCanvas * mapCanvas() const
Returns the map canvas.
ColumnType
The type of a column.
This is a container for configuration of the attribute table.
Represents a vector layer which manages a vector based data sets.
QgsVectorLayerCache * layerCache() const
Returns the layerCache this filter acts on.
QModelIndex mapToMaster(const QModelIndex &proxyIndex) const