-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate policy on QgsFields when duplicate features #57217
Conversation
…e what has to be done on duplicating a feature.
@@ -521,8 +521,7 @@ Qgis::GeometryOperationResult QgsVectorLayerEditUtils::splitFeatures( const QgsC | |||
switch ( field.splitPolicy() ) | |||
{ | |||
case Qgis::FieldDomainSplitPolicy::DefaultValue: | |||
// TODO!!! | |||
|
|||
//do nothing - default values are determined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment concerns not the duplicate policy but the split policy. I removed your "TODO" @nyalldawson because as far as I understand the default values are determined by doing "nothing".
This fixes #55477 |
a5c5e20
to
39e6dbd
Compare
I'm curious -- Are you aware of any formats which store this information? |
no, nothing comes to mind. |
Thanks for your thoughts @nyalldawson and @rouault Still I think this is the best place there, to have it aligned to the other (similar) settings. Maybe we can rename it to |
I agree @signedav this is independent from "domains", so |
…ot like the Merge or Split Policy it does not affect the FieldDomains but only the Fields instead
@signedav A documentation ticket will be opened at https://github.com/qgis/QGIS-Documentation when this PR is merged. Please update the description (not the comments) with helpful description and screenshot to help the work from documentors. Thank you! |
@signedav |
This pull request has been tagged for the changelog.
You can edit the description. Format available for credits
Thank you! |
Description
On duplicating a feature (and it's children) the duplicate policy will be concerned for fields. There are three options:
Default is "Duplicate Value".
A good use case where this is useful is on a timestamp as default value, when this feature has been created (means duplicated).
Technical info
This functionality is implemented the same way than the split policy, although the split policy is based on the policy of the field domain (if available) what means it concerns the
OGRFieldDomainSplitPolicy
. This is not part of the duplicate policy. The duplicate policy only concerns the QgsFields and is configured over the attribute form properties.Still I named the enumFieldDomainDuplicatePolicy
- because maybe one time the OGR api offers this policy as well and with this we can use it the same way.That's why it's named
FieldDuplicatePolicy
.