17 #ifndef QGSATTRIBUTETABLEMODEL_H
18 #define QGSATTRIBUTETABLEMODEL_H
20 #include <QAbstractTableModel>
21 #include <QModelIndex>
52 SortRole = Qt::UserRole + 1,
53 FeatureIdRole = Qt::UserRole + 2,
54 FieldIndexRole = Qt::UserRole + 3
69 virtual void loadLayer();
75 virtual int rowCount(
const QModelIndex &parent = QModelIndex() )
const override;
81 int columnCount(
const QModelIndex &parent = QModelIndex() )
const override;
89 QVariant headerData(
int section, Qt::Orientation orientation,
int role = Qt::DisplayRole )
const override;
96 virtual QVariant data(
const QModelIndex &
index,
int role )
const override;
104 virtual bool setData(
const QModelIndex &
index,
const QVariant &value,
int role = Qt::EditRole )
override;
110 Qt::ItemFlags flags(
const QModelIndex &
index )
const override;
117 void reload(
const QModelIndex &index1,
const QModelIndex &index2 );
122 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex() )
override;
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 );
234 void progress(
int i,
bool &cancel );
241 virtual void updatedFields();
248 virtual void editCommandEnded();
253 virtual void attributeDeleted(
int idx );
262 virtual void attributeValueChanged(
QgsFeatureId fid,
int idx,
const QVariant &value );
277 virtual void layerDeleted();
296 virtual void loadAttributes();
313 QHash<QgsFeatureId, QVariant> mFieldCache;
322 QRect mChangedCellBounds;