Bug report #12303

copy/paste style from one vector layer to another of different geometry type

Added by Olivier Dalang over 6 years ago. Updated over 2 years ago.

Affected QGIS version:2.8.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:20481


Hi !

Currently, when one tries to copy the style from one vector layer to another of different geometry type (for example from a polygon layer to a point layer), it replaces the whole style tab by the style tab of the source geometry type. So, you end up with a UI to define polygons on a point layers.
It seem not possible to go back, so the layer basically becomes unusable, and doesn't display anything anymore.

A quick fix (bugfix) could be to restrict pasting style on a layer with a different geometry type.

A better fix (feature?) would be to still allow to copy the style, copying everything which can be kept (classification, labels, form, ...), and discarding the rest. Maybe we could even keep something like the color of the classification ?

A very typical use case is when you have a table of type "geometry", and add it three times to your project (once for polygons, once for lines, and once for points). You have three times the exact same structure, and you want the exact same forms/labels/classification. If there are a lots of attributes, it's a pain to have to do the same work three times.

Thanks !



#1 Updated by Giovanni Manghi about 4 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Johannes Kroeger over 3 years ago

I tried pasting a point layer style to a polygon layer in 2.18.15 and got an error message "Cannot paste style: Cannot apply style to layer with a different geometry type". So I would say this can be closed as fixed.

#3 Updated by Giovanni Manghi over 2 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF