17 #ifndef QGSATTRIBUTETABLEFILTERMODEL_H 18 #define QGSATTRIBUTETABLEFILTERMODEL_H 20 #include <QSortFilterProxyModel> 22 #include <QModelIndex> 30 class QItemSelectionModel;
61 ColumnTypeActionButton
100 void setSelectedOnTop(
bool selectedOnTop );
107 bool selectedOnTop();
115 virtual void setFilteredFeatures(
const QgsFeatureIds &ids );
170 inline QModelIndex
mapToMaster(
const QModelIndex &proxyIndex )
const {
return mapToSource( proxyIndex ); }
172 inline QModelIndex
mapFromMaster(
const QModelIndex &sourceIndex )
const {
return mapFromSource( sourceIndex ); }
174 QModelIndex mapToSource(
const QModelIndex &proxyIndex )
const override;
176 QModelIndex mapFromSource(
const QModelIndex &sourceIndex )
const override;
178 Qt::ItemFlags flags(
const QModelIndex &index )
const override;
187 void sort(
int column, Qt::SortOrder order = Qt::AscendingOrder )
override;
196 void sort(
const QString &expression, Qt::SortOrder order = Qt::AscendingOrder );
201 QString sortExpression()
const;
206 QVariant data(
const QModelIndex &index,
int role )
const override;
208 QVariant headerData(
int section, Qt::Orientation orientation,
int role )
const override;
214 int actionColumnIndex()
const;
216 int columnCount(
const QModelIndex &parent )
const override;
232 void sortColumnChanged(
int column, Qt::SortOrder order );
242 bool filterAcceptsRow(
int sourceRow,
const QModelIndex &sourceParent )
const override;
248 void generateListOfVisibleFeatures();
254 bool lessThan(
const QModelIndex &left,
const QModelIndex &right )
const override;
262 void extentsChanged();
265 void selectionChanged();
266 void onColumnsChanged();
272 bool mSelectedOnTop =
false;
276 QVector<int> mColumnMapping;
277 int mapColumnToSource(
int column )
const;
QgsVectorLayer * layer() const
Returns the layer this filter acts on.
QgsAttributeTableModel * masterModel() const
Returns the table model this filter is using.
QModelIndex mapFromMaster(const QModelIndex &sourceIndex) const
QSet< QgsFeatureId > QgsFeatureIds
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