17 #ifndef QGSATTRIBUTETABLEMODEL_H
18 #define QGSATTRIBUTETABLEMODEL_H
20 #include <QAbstractTableModel>
21 #include <QModelIndex>
32 class QgsEditorWidgetFactory;
51 SortRole = Qt::UserRole + 1,
52 FeatureIdRole = Qt::UserRole + 2,
53 FieldIndexRole = Qt::UserRole + 3
68 virtual void loadLayer();
74 virtual int rowCount(
const QModelIndex &parent = QModelIndex() )
const;
80 int columnCount(
const QModelIndex &parent = QModelIndex() )
const;
88 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const;
95 virtual QVariant data(
const QModelIndex &
index,
int role )
const;
103 virtual bool setData(
const QModelIndex &
index,
const QVariant &value,
int role = Qt::EditRole );
109 Qt::ItemFlags flags(
const QModelIndex &
index )
const;
116 void reload(
const QModelIndex &index1,
const QModelIndex &index2 );
121 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() );
141 int fieldIdx(
int col )
const;
146 int fieldCol(
int idx )
const;
174 void executeAction(
int action,
const QModelIndex &idx )
const;
179 void executeMapLayerAction(
QgsMapLayerAction* action,
const QModelIndex &idx )
const;
185 QgsFeature feature(
const QModelIndex &idx )
const;
194 void prefetchColumnData(
int column );
205 void progress(
int i,
bool &cancel );
212 virtual void updatedFields();
219 virtual void editCommandEnded();
224 virtual void attributeDeleted(
int idx );
233 virtual void attributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
248 virtual void layerDeleted();
267 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 of 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.
QVector< QgsEditorWidgetFactory * > mWidgetFactories
This class wraps a request for features to a vector layer (or directly its vector data provider)...
QList< int > QgsAttributeList
QVector< QgsEditorWidgetConfig > mWidgetConfigs
QHash< QgsFeatureId, int > mIdRowMap
QgsVectorLayerCache * layerCache() const
Returns the layer cache this model uses as backend.
This class caches features of a given QgsVectorLayer.
QVector< QVariant > mAttributeWidgetCaches
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.