1

I often use the same styles over and over. So I have to open Properties, load style, search for the style and so on.

Is there a way to just make an own toolbar with an icon to set a style to a layer?

How would I do that?

Kadir Şahbaz
  • 76,800
  • 56
  • 247
  • 389
Stefan
  • 74
  • 5
  • Using default style ? (https://gis.stackexchange.com/questions/183533/setting-default-parameter-style-for-new-layers-in-qgis) – J.R Jan 23 '23 at 09:32
  • I dont want that all layers have the same style (default style). I want to set a style with just one click (on an icon). – Stefan Jan 23 '23 at 09:40
  • In both cases (using properties window or making an icon on a toolbar), you have to specify a style anyway. – Kadir Şahbaz Jan 23 '23 at 10:36
  • I commented too fast, what I mean to suggest was to use the "Save as Default" option for layer style (open the layer properties, click the 'Style' drop down on the bottom left and 'Save as Default') – J.R Jan 23 '23 at 10:54
  • 1
    Export the source layer QML with just the symbology, then apply the script from the linked answer. Eventually hard-code the file path instead of opening the dialog box to select the file – JGH Jan 23 '23 at 12:18
  • Thanks for your responses, but thats not what im searching for. Also the linked answer doesnt speed up my workflow. To clarify what im looking for. For example: I load a DEM, than i change the band to "hillshade" and the resampling to "bilinear". Thats 7 clicks. To load a qml style I also have to click at least 7 times. When there is already a DEM i can improve my speed by copy/paste style. But what I want is to click on the DEM-Layer and than a second click on a button. And behind this button should be some "python-magic" which apply a certain QML to the layer. something like JGH mentioned. – Stefan Jan 24 '23 at 15:26

1 Answers1

1

You can copy and paste All style categories with the shortcut keys (there are no options for specific styles, e.g. only Symbology):

enter image description here

enter image description here

enter image description here

Comrade Che
  • 7,091
  • 27
  • 58