Duplicate policy on QgsFields when duplicate features
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 enum FieldDomainDuplicatePolicy - because maybe one time the OGR api offers this policy as well and with this we can use it the same way.
This fixes #55477
@rouault
Still I named the enum FieldDomainDuplicatePolicy - because maybe one time the OGR api offers this policy as well and with this we can use it the same way.
I'm curious -- Are you aware of any formats which store this information?
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 FieldDuplicatePolicy to imply that it has nothing to do with domains. What do you think?
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
FieldDuplicatePolicyto imply that it has nothing to do with domains. What do you think?
I agree @signedav this is independent from "domains", so FieldDuplicatePolicy would be more appropriate (or rather using Domain would not be appropriate)
🪟 Windows builds ready!
Windows builds of this PR are available for testing here. Debug symbols for this build are available here.
(Built from commit cfe71973c2f7496d08d38f2545199f03841d1869)
@signedav This pull request has been tagged as requiring documentation.
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. Also, any commit having [needs-doc] or [Needs Documentation] in will see its message pushed to the issue, so please be as verbose as you can.
Thank you!
@signedav A documentation ticket has been opened at https://github.com/qgis/QGIS-Documentation/issues/9085 It is your responsibility to visit this ticket and add as much detail as possible for the documentation team to correctly document this change. Thank you!
@signedav
This pull request has been tagged for the changelog.
- The description will be harvested so please provide a "nearly-ready" text for the final changelog
- If possible, add a nice illustration of the feature. Only the first one in the description will be harvested (GIF accepted as well)
- If you can, it's better to give credits to your sponsor, see below for different formats.
You can edit the description.
Format available for credits
Funded by NAMEFunded by URLFunded by NAME URLSponsored by NAMESponsored by URLSponsored by NAME URL
Thank you!