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 14, 2024
1 parent 657ef5f commit bf41979
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

1 comment on commit bf41979

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.