pyqgis开发记录,矢量图层设置无填充颜色
layer = QgsVectorLayer('polygon?crs=epsg:4326&field=id:integer&field=wgbh:string(32)', layername, 'memory')#LineString
# pr = layer.dataProvider()
self.arrLayers.append(layer)
#设置无填充
symbols = layer.renderer().symbols(QgsRenderContext())
# 一般单样式渲染的图层,symbols里面就只有一个元素
sym = symbols[0]
symLyr = sym.symbolLayer(0)
symLyr.setBrushStyle(0)