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 15, 2024
1 parent c04c3a0 commit 16f0d6d
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 16f0d6d

@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.