I am trying to make the color of my buffer totally transparent, but I want to keep the stroke fully colored.
I tried the following :
color1 = QtGui.QColor('#f3a6b2') #or whatever, as it will be transparent
color2 = QtGui.QColor('#ffffff')
symbo = QgsSimpleFillSymbolLayer(color = color1, strokeColor = color2, strokeWidth = 1.26)
buffer_loc.setOpacity(0)
buffer_loc.renderer().symbol().changeSymbolLayer(0, symbo)
buffer_loc.triggerRepaint()
But the opacity applies to the whole polygon, including the stroke. Any tips ? I only found answers regarding rasters but nothing for vector layers so far...