3

I'am working on a plugin which is loading layers automatically. When the layers are loaded they should get categorized. I done it with svg files but i have more symbols in my Style Manager which I want to use for the categorization. Do anybody know how I can read all symbols out of the Style Manager? I use QGIS 3.0

1

You can access the default style library via

QgsStyle.defaultStyle()

This gives you a QgsStyle object (see https://qgis.org/pyqgis/3.0/core/other/QgsStyle.html). From there, you can call methods like

style=QgsStyle.defaultStyle()
style.symbolNames() # returns a list of symbol names
style.symbol('dash blue') # returns the symbol with name 'dash blue'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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