-
-
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
Show a warning when pasted feature geometry collapsed #8125
Show a warning when pasted feature geometry collapsed #8125
Conversation
... due to due to intersection avoidance Features are still pasted but the user is warned. Fixes qgis#20020
If the geoms where originally invalid, do not show the warning.
messageBar()->pushMessage( tr( "Paste features" ), | ||
tr( "%1 of %2 features could be successfully pasted." ).arg( nCopiedFeatures ).arg( nTotalFeatures ), | ||
Qgis::Warning, messageTimeout() ); | ||
message = tr( "%1 of %2 features could be successfully pasted." ).arg( nCopiedFeatures ).arg( nTotalFeatures ); |
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.
tr( "%1 of %n feature(s) ...", nTotalFeatures ).arg( nCopiedFeatures )
should be supersmart about things. But I never verified ;)
QgsExpressionContext context = pasteVectorLayer->createExpressionContext(); | ||
|
||
|
||
QgsFeatureList compatibleFeatures( QgsVectorLayerUtils::makeFeaturesCompatible( features, pasteVectorLayer ) ); |
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.
Are we certain that features here always have their original QgsFields set?
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.
I would say yes, AFAIK features can only come from a copy operation from a layer source, QgsFields should be there. I did a manual test with copy/paste from layers with different fieldset but sharing a few field names and everything worked just fine if is that what you are worried about.
... due to due to intersection avoidance
Features are still pasted but the user is warned.
Fixes #20020