17 #ifndef QGSATTRIBUTETABLEMODEL_H
18 #define QGSATTRIBUTETABLEMODEL_H
20 #include <QAbstractTableModel>
21 #include <QModelIndex>
50 SortRole = Qt::UserRole + 1,
51 FeatureIdRole = Qt::UserRole + 2,
52 FieldIndexRole = Qt::UserRole + 3
69 virtual void loadLayer();
75 virtual int rowCount(
const QModelIndex &parent = QModelIndex() )
const;
81 int columnCount(
const QModelIndex &parent = QModelIndex() )
const;
89 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const;
96 virtual QVariant data(
const QModelIndex &
index,
int role )
const;
104 virtual bool setData(
const QModelIndex &
index,
const QVariant &value,
int role = Qt::EditRole );
110 Qt::ItemFlags flags(
const QModelIndex &
index )
const;
117 void reload(
const QModelIndex &index1,
const QModelIndex &index2 );
122 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() );
142 int fieldIdx(
int col )
const;
147 int fieldCol(
int idx )
const;
175 void executeAction(
int action,
const QModelIndex &idx )
const;
180 void executeMapLayerAction(
QgsMapLayerAction* action,
const QModelIndex &idx )
const;
186 QgsFeature feature(
const QModelIndex &idx )
const;
195 void prefetchColumnData(
int column );
206 void progress(
int i,
bool &cancel );
213 virtual void updatedFields();
220 virtual void editCommandEnded();
225 virtual void attributeDeleted(
int idx );
234 virtual void attributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
249 virtual void layerDeleted();
266 virtual void loadAttributes();
QRect mChangedCellBounds
Holds the bounds of changed cells while an update operation is running top = min row left = min colum...
QgsAttributeList mAttributes
QHash< int, QgsFeatureId > mRowIdMap
QgsFeatureRequest mFeatureRequest
QHash< QgsFeatureId, QVariant > mFieldCache
Allows caching one specific column (used for sorting)
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
A model backed by a QgsVectorLayerCache which is able to provide feature/attribute information to a Q...
Map canvas is a class for displaying all GIS data types on a canvas.
QgsVectorLayerCache * mLayerCache
int mCachedField
The currently cached column.
QMap< int, const QMap< QString, QVariant > * > mValueMaps
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
QHash< QgsFeatureId, int > mIdRowMap
QgsVectorLayerCache * layerCache() const
Returns the layer cache this model uses as backend.
This class caches features of a given QgsVectorLayer.
QgsVectorLayer * layer() const
Returns the layer this model uses as backend.
Represents a vector layer which manages a vector based data sets.
An action which can run on map layers.