[Qgis-developer] Remove Feature
alexandre.badez at gmail.com
Tue Feb 28 11:25:06 EST 2012
I'm coding a plugin in python and I would like to understand what
append during this:
self._layer.dataProvider().deleteFeatures([v.id() for v in
self._layer.dataProvider().addFeatures([v for v in
because features are not delete...
So... I get a look in the C++ code.. here is what I've found in
bool QgsVectorDataProvider::addFeatures( QgsFeatureList &flist )
Q_UNUSED( flist );
bool QgsVectorDataProvider::deleteFeatures( const QgsFeatureIds &ids )
Q_UNUSED( ids );
Well... the data provider do not seems to do anything really useful...
So I get a look to the QgsVectorLayer:
Code: Select all
bool QgsVectorLayer::addFeature( QgsFeature& f, bool alsoUpdateExtent )
// does a lot of things
So here is my questions:
* My python code hat use the data provider "work" as expected (it
display something) but if I do this:
self._layer.addFeatures([v for v in self._object_map.itervalues()])
it do not work (do not display anything).
* The deleteFeature do not seems to work neither on the data
provider nor on the layer... why ? Is it a bug ?
* What am I missing, or doing wrong ?
By the way, I also check the code on SVN, (qgsvectorlayer v15857 and
qgsvectordataprovider v15197) and the code is similar to the one on
More information about the Qgis-developer