1
/***************************************************************************
2
QgsAttributeTableMemoryModel.h - Memory Model for attribute table
6
email : weetya (at) gmail.com
8
***************************************************************************
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
15
***************************************************************************/
17
#ifndef QGSATTRIBUTETABLEMEMORYMODEL_H
18
#define QGSATTRIBUTETABLEMEMORYMODEL_H
20
#include <QAbstractTableModel>
21
#include <QModelIndex>
26
#include "qgsfeature.h" //QgsAttributeMap
27
#include "qgsvectorlayer.h" //QgsAttributeList
28
#include "qgsattributetablemodel.h"
29
#include "qgsattributetableidcolumnpair.h"
31
class QgsAttributeTableMemoryModel : public QgsAttributeTableModel
38
* @param theLayer layer pointer
40
QgsAttributeTableMemoryModel( QgsVectorLayer *theLayer );
44
* Launched when a feature has been deleted
45
* @param fid feature id
47
virtual void featureDeleted( int fid );
49
* Launched when a feature has been deleted
50
* @param fid feature id
52
virtual void featureAdded( int fid );
54
* Launched when layer has been deleted
56
virtual void layerDeleted();
60
* Launched when attribute value has been changed
61
* @param fid feature id
62
* @param idx attribute index
63
* @param value new value
65
virtual void attributeValueChanged( int fid, int idx, const QVariant &value );
69
* load feature fid into mFeat
70
* @param fid feature id
71
* @return feature exists
73
virtual bool featureAtId( int fid );
76
* Loads the layer into the model
78
virtual void loadLayer();
80
QHash<int, QgsFeature> mFeatureMap;
83
#endif //QGSATTRIBUTETABLEMEMORYMODEL_H