Skip to content

Commit 497191b

Browse files
committed
Transactions: addFeature propagates new feature id
1 parent 055ef76 commit 497191b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/core/qgsvectorlayereditpassthrough.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
bool QgsVectorLayerEditPassthrough::addFeature( QgsFeature& f )
2121
{
2222

23-
if ( L->dataProvider()->addFeatures( QgsFeatureList() << f ) )
23+
QgsFeatureList fl;
24+
fl << f;
25+
if ( L->dataProvider()->addFeatures( fl) )
2426
{
27+
f.setFeatureId( fl.first().id() );
2528
emit featureAdded( f.id() );
2629
return true;
2730
}

0 commit comments

Comments
 (0)