Skip to content

Instantly share code, notes, and snippets.

@gacarrillor
Created March 25, 2018 12:53
Show Gist options
  • Save gacarrillor/3d02848081f1082a0379ffb310fdc998 to your computer and use it in GitHub Desktop.
Save gacarrillor/3d02848081f1082a0379ffb310fdc998 to your computer and use it in GitHub Desktop.
Fix #18532
while ( featureIt != features.constEnd() )
{
QgsAttributes srcAttr = featureIt->attributes();
QgsAttributeMap dstAttr;
for ( int src = 0; src < srcAttr.count(); ++src )
{
int dst = remap.value( src, -1 );
if ( dst < 0 )
continue;
QVariant srcValue = srcAttr.at( src );
int type = pasteVectorLayer->fields().field( dst ).type();
if srcValue->canConvert( type )
srcValue->convert( type );
dstAttr[ dst ] = srcValue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment