6

I am constantly moving layers in and out of my projects, I was able to set default style for layers and they all the layers I drag and drop to my project get the same style by default.

Lately I have discovered that I can create rule based symbology as a layer style which allows me to hide unselected features while I'm working on a selected feature.

I am wondering if it's possible to save rule based symbology as default for imported vector layers? When I use save symbol as default it saves a QGIS configuration file next to me shapefile but that's good for only one layer, as soon as I change the project I need to set everything up from scratch again by going to rule based symbology, create two rules, fill them in with the expression etc.

2 Answers 2

4

You can save a style, and then load that style to another layer.

  • Go into the layer properties > symbology (the same place where you saved the style as default), choose the option to "save style" to save the style as a QML or SLD file.
  • In the other layer, go to the same place and choose "load style" to load that style into this layer.

enter image description here

If you already have a layer in the current project with the style you want, you can copy and paste that style onto another layer in the same project.

  • Right click on that layer in the Layer panel > Styles > Copy Style > 'all style categories' or choose one style category from the list.
  • Right click on the other layer > Styles > Paste Style > 'all style categories' or choose a category

Unfortunately it doesn't seem like you can add a saved style to the default styles or to the style manager. The default styles only allow you to choose a simple symbol type, they don't allow the more complicated symbology types. The style manager only accepts XML files. It doesn't accept either format in which you can save a style (QML and SLD).

enter image description here

If you want, you could request that feature be added to future releases of QGIS.

1
  • Hey, sorry for late response and thank you for your answer & time. Very much appreciated. As you mentioned it's not exactly what I'm looking for but these are some good workarounds. I hope they add something similar in the upcoming releases. Thanks again.
    – puredata
    Dec 9, 2019 at 16:29
1

Usually, if you have a style named like a dataset, that one gets loaded and applied, too. You could link one style in the filesystem (to other filenames).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.