[QGIS-Developer] PyQGIS: how to retrieve symbolLayers in renderPass order

Tom Chadwin tom.chadwin at nnpa.org.uk
Sat May 13 03:49:02 PDT 2017


In the absence of such a method, I'm doing this:

symbolLayers = {}
for i in xrange(symbol.symbolLayerCount()):
    sl = symbol.symbolLayer(i)
    if renderer.usingSymbolLevels():
        k = sl.renderingPass()
    else:
        k = i
    symbolLayers[k] = sl
stackedSLs = sorted(symbolLayers.iterkeys())

I think it works:

https://github.com/tomchadwin/qgis2web/commit/c5f4d457d32057ab6b6f56abab49d24008d20732

If anyone has a better method, do let me know.
    
Thanks

Tom



-----
Buy Pie Spy: Adventures in British pastry 2010-11 on Amazon 
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/PyQGIS-how-to-retrieve-symbolLayers-in-renderPass-order-tp5320327p5320427.html
Sent from the QGIS - Developer mailing list archive at Nabble.com.


More information about the QGIS-Developer mailing list