Quantum GIS API Documentation  master-4435c4f
src/gui/attributetable/qgsattributetablememorymodel.h
Go to the documentation of this file.
00001 /***************************************************************************
00002   QgsAttributeTableMemoryModel.h - Memory Model for attribute table
00003   -------------------
00004          date                 : Feb 2009
00005          copyright            : Vita Cizek
00006          email                : weetya (at) gmail.com
00007 
00008  ***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU General Public License as published by  *
00012  *   the Free Software Foundation; either version 2 of the License, or     *
00013  *   (at your option) any later version.                                   *
00014  *                                                                         *
00015  ***************************************************************************/
00016 
00017 #ifndef QGSATTRIBUTETABLEMEMORYMODEL_H
00018 #define QGSATTRIBUTETABLEMEMORYMODEL_H
00019 
00020 #include <QAbstractTableModel>
00021 #include <QModelIndex>
00022 #include <QObject>
00023 #include <QHash>
00024 
00025 //QGIS Includes
00026 #include "qgsfeature.h" //QgsAttributeMap
00027 #include "qgsvectorlayer.h" //QgsAttributeList
00028 #include "qgsattributetablemodel.h"
00029 #include "qgsattributetableidcolumnpair.h"
00030 
00031 class QgsAttributeTableMemoryModel : public QgsAttributeTableModel
00032 {
00033     Q_OBJECT
00034 
00035   public:
00041     QgsAttributeTableMemoryModel( QgsMapCanvas *theCanvas, QgsVectorLayer *theLayer );
00042 
00047     virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;
00048 
00052     bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );
00053 
00054   protected slots:
00059     virtual void featureDeleted( QgsFeatureId fid );
00065     virtual void featureAdded( QgsFeatureId fid, bool inOperation = true );
00069     virtual void layerDeleted();
00070 
00071   private slots:
00078     virtual void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value );
00079 
00080   private:
00086     virtual bool featureAtId( QgsFeatureId fid ) const;
00087 
00091     virtual void loadLayer();
00092 };
00093 
00094 #endif //QGSATTRIBUTETABLEMEMORYMODEL_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines