QGIS API Documentation  2.14.0-Essen
qgsvectorlayereditpassthrough.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsvectorlayereditpassthrough.h
3  ---------------------
4  begin : Jan 12 2015
5  copyright : (C) 2015 by Sandro Mani
6  email : manisandro at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #ifndef QGSVECTORLAYEREDITPASSTHROUGH_H
16 #define QGSVECTORLAYEREDITPASSTHROUGH_H
17 
19 
20 class QgsVectorLayer;
21 
23 {
24  Q_OBJECT
25  public:
27  bool isModified() const override;
28  bool addFeature( QgsFeature& f ) override;
29  bool addFeatures( QgsFeatureList& features ) override;
30  bool deleteFeature( QgsFeatureId fid ) override;
31  bool deleteFeatures( const QgsFeatureIds& fids ) override;
32  bool changeGeometry( QgsFeatureId fid, QgsGeometry* geom ) override;
33  bool changeAttributeValue( QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue = QVariant() ) override;
34  bool addAttribute( const QgsField &field ) override;
35  bool deleteAttribute( int attr ) override;
36  bool commitChanges( QStringList& commitErrors ) override;
37  void rollBack() override;
38 
39  private:
40  bool mModified;
41 };
42 
43 #endif // QGSVECTORLAYEREDITPASSTHROUGH_H
virtual bool addAttribute(const QgsField &field)
Add an attribute field (but does not commit it) returns true if the field was added.
virtual bool addFeatures(QgsFeatureList &features)
Insert a copy of the given features into the layer (but does not commit it)
virtual bool addFeature(QgsFeature &f)
Adds a feature.
virtual void rollBack()
Stop editing and discard the edits.
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:76
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Definition: qgsfeature.h:187
virtual bool deleteFeatures(const QgsFeatureIds &fid)
Deletes a set of features from the layer (but does not commit it)
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:44
virtual bool commitChanges(QStringList &commitErrors)
Attempts to commit any changes to disk.
virtual bool deleteAttribute(int attr)
Delete an attribute field (but does not commit it)
virtual bool deleteFeature(QgsFeatureId fid)
Delete a feature from the layer (but does not commit it)
qint64 QgsFeatureId
Definition: qgsfeature.h:31
virtual bool changeAttributeValue(QgsFeatureId fid, int field, const QVariant &newValue, const QVariant &oldValue=QVariant())
Changed an attribute value (but does not commit it)
Represents a vector layer which manages a vector based data sets.
virtual bool isModified() const
Returns true if the provider has been modified since the last commit.
virtual bool changeGeometry(QgsFeatureId fid, QgsGeometry *geom)
Change feature's geometry.