I have some polygons in a shp file that I need to change their line width. I head joined them in one group

enter image description here

Is there a way to change the line with for all of the layer in the group simultaneously and not one after the other?

share|improve this question
up vote 10 down vote accepted

With a little help from Python, we could set the border width for all layers in your "State" group to a specific value (e.g. 0.16 as shown in your image).

Try testing the following in the Python Console:

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)
share|improve this answer
1  
I will look into it soon. Thanks! – Nitzan Matan Jun 21 at 13:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.