I'm trying to customize my layers from a python script. I would like to add several symbol layers to features.
# Creating symbol layers
symbolLayers = list()
lFill = QgsSimpleFillSymbolLayer.create({
"color" : "{r},{g},{b},255".format(r = randomized_color[0],g = randomized_color[1],b = randomized_color[2])
})
symbolLayers.append(lFill)
# Create the fill symbol
symbol = QgsFillSymbol(symbolLayers)
# Adding to the current renderer
currentLayer.renderer().setSymbol(symbol)
currentLayer.triggerRepaint()
I have at this time only one symbol layer but when it will work, i will add more symbol layers.
It crash only when i add the symbol to the renderer. Before, it seems to work (setSymbol).