Answers:
在Python的帮助下,我们可以将“状态”组中所有图层的边框宽度设置为特定值(例如0.16
,如图所示)。
尝试在Python控制台中测试以下内容:
root = QgsProject.instance().layerTreeRoot()
state_group = root.findGroup("State")
border_width = 0.16
for layers in state_group.children():
layer = layers.layer()
symbols = layer.rendererV2().symbols()
symbols[0].symbolLayer(0).setBorderWidth(border_width)
layer.triggerRepaint()
iface.legendInterface().refreshLayerSymbology(layer)