File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -514,17 +514,20 @@ QgsAttributeMap QgsMergeAttributesDialog::mergedAttributesMap() const
514
514
}
515
515
516
516
resultMap = mFeatureList [0 ].attributeMap ();
517
- // go through all the items and replace the values in the attribute map
518
- for ( int i = 0 ; i < resultMap.size (); ++i )
517
+ int index = 0 ;
518
+ QgsAttributeMap::iterator it = resultMap.begin ();
519
+
520
+ for ( ; it != resultMap.end (); ++it )
519
521
{
520
- QTableWidgetItem* currentItem = mTableWidget ->item ( mFeatureList .size () + 1 , i );
522
+ QTableWidgetItem* currentItem = mTableWidget ->item ( mFeatureList .size () + 1 , index );
521
523
if ( !currentItem )
522
524
{
523
525
continue ;
524
526
}
525
527
QString mergedString = currentItem->text ();
526
528
QVariant newValue ( mergedString );
527
- resultMap.insert ( i, newValue );
529
+ resultMap.insert ( it.key (), newValue );
530
+ ++index ;
528
531
}
529
532
530
533
return resultMap;
You can’t perform that action at this time.
0 commit comments