Skip to content
Permalink
Browse files

use toMap to convert to attributeMap

  • Loading branch information
signedav committed Nov 7, 2018
1 parent 4ac0631 commit 913719fd374a915201d646f33c3333e73a6f01f8
Showing with 1 addition and 9 deletions.
  1. +1 −9 src/core/qgsvectorlayerutils.cpp
@@ -464,15 +464,7 @@ QgsFeature QgsVectorLayerUtils::duplicateFeature( QgsVectorLayer *layer, const Q
QgsExpressionContext context = layer->createExpressionContext();
context.setFeature( feature );

//create the attribute map
QgsAttributes srcAttr = feature.attributes();
QgsAttributeMap dstAttr;
for ( int src = 0; src < srcAttr.count(); ++src )
{
dstAttr[ src ] = srcAttr.at( src );
}

QgsFeature newFeature = createFeature( layer, feature.geometry(), dstAttr, &context );
QgsFeature newFeature = createFeature( layer, feature.geometry(), feature.attributes().toMap(), &context );

const QList<QgsRelation> relations = project->relationManager()->referencedRelations( layer );

0 comments on commit 913719f

Please sign in to comment.
You can’t perform that action at this time.