Skip to content

Commit

Permalink
Improve feature attribute transfer by allowing copying _some_ express…
Browse files Browse the repository at this point in the history
…ion-driven attributes
  • Loading branch information
nirvn committed Oct 12, 2024
1 parent 7ae9dd1 commit c8e4b68
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/featuremodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,10 @@ bool FeatureModel::updateAttributesFromFeature( const QgsFeature &feature )
continue;
}

// Do not paste values for attributes that have default values
if ( !mFeature.fields()[idx].defaultValueDefinition().expression().isEmpty() )
const QgsField field = mFeature.fields()[idx];
if ( !field.defaultValueDefinition().expression().isEmpty() && !field.defaultValueDefinition().applyOnUpdate() )
{
// Skip attributes that have default value set only once on feature creation to avoid overriding generated UUIDs
continue;
}

Expand Down

0 comments on commit c8e4b68

Please sign in to comment.