Feature request #5115

Save more than one style in a .qml file and give user a choice when loading the layer

Added by Alister Hood about 5 years ago. Updated over 1 year ago.

Status:Feedback Start Date:03/04/2012
Priority:Low Due date:
Assigned to:- % Done:

50%

Category:Symbology
Target version:Future Release - Nice to have
Platform: Resolution:
Platform version: Pull Request or Patch supplied:No
Status info: Tag:

Description

Someone might be interested in this:

I saw a request for another desktop GIS for the ability to save multiple symbology files for a layer (with a suffix after the layer name so they have unique file names). When loading the layer the different symbologies would be automatically detected and the user given a choice of which style to use.

Saving each symbology in a separate file doesn't seem very good to me because it risks naming conflicts (i.e. there might be other layers with the same file name plus a suffix). I think a better solution would be to save multiple symbologies in the same file. The downside of this would be that you couldn't just copy for another layer the .qml for a single style.

History

Updated by Giovanni Manghi almost 5 years ago

  • Target version set to Version 2.0.0

Updated by Pirmin Kalberer over 4 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

Updated by Alister Hood about 4 years ago

Someone might be interested in this:

I saw a request for another desktop GIS for the ability to save multiple symbology files for a layer (with a suffix after the layer name so they have unique file names). When loading the layer the different symbologies would be automatically detected and the user given a choice of which style to use.

Saving each symbology in a separate file doesn't seem very good to me because it risks naming conflicts (i.e. there might be other layers with the same file name plus a suffix). I think a better solution would be to save multiple symbologies in the same file. The downside of this would be that you couldn't just copy for another layer the .qml for a single style.

Saving multiple styles in the same .qml file would probably also imply deeper integration of this feature into QGIS, not just the ability to choose a symbology when you load the layer:
- multiple styles[*] for a layer would also be saved in the project file.
- they would be listed in the layer properties, allowing you to switch between them easily. Maybe when you right-click on a layer in the "layers" panel (aka TOC) there could also be a submenu which lists the styles, and you could switch quickly that way.
- there should be a mechanism to choose which layer style to use in a composer map, so you can use different styles in different maps, without having to switch rules on or off every time you view a map, or add a layer to the project multiple times.

[*] another name like "themes" is probably needed, because when you use e.g. the rule-based renderer you really have a collection of styles, one for each rule.

Updated by Médéric RIBREUX over 1 year ago

  • Status changed from Open to Feedback
  • % Done changed from 0 to 50

Hello, bug triage...

multi-style for layers is completely implemented in QGIS 2.13 master (and in previous versions).

For the moment, you can only save a style per QML. Perhaps is it time to implement multi-style QML saving/loading ? I think this is not so trivial for the UI because we need to let the users decide to save styles on an individual or grouped basis (sometimes, I just want to export a single style from my multi-style layer, some other times, I want to export two or three styles simultaneously).

Also available in: Atom