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();