17 #ifndef QGSATTRIBUTETABLEMODEL_H
18 #define QGSATTRIBUTETABLEMODEL_H
20 #include <QAbstractTableModel>
21 #include <QModelIndex>
49 SortRole = Qt::UserRole + 1,
50 FeatureIdRole = Qt::UserRole + 2,
51 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;
180 QgsFeature feature(
const QModelIndex &idx )
const;
189 void prefetchColumnData(
int column );
198 void progress(
int i,
bool &cancel );
205 virtual void updatedFields();
210 virtual void attributeDeleted(
int idx );
219 virtual void attributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
230 virtual void featureAdded(
QgsFeatureId fid,
bool inOperation =
true );
235 virtual void layerDeleted();
252 virtual void loadAttributes();