[Qgis-user] Change properties of multiple layer at once

Raymond Nijssen r.nijssen at terglobo.nl
Fri Apr 1 01:13:37 PDT 2022


Don't know how to do that using the GUI, but for the opacity you can use 
these 2 lines of python in the QGIS python console. It will set all your 
selected layers to 50% opacity.


for layer in iface.layerTreeView().selectedLayers():
     layer.setOpacity(.5)


I think the stroke style is harder to change because all these layers 
can have different symbologies.

Hope it helps!
Raymond


On 01-04-2022 09:47, Roland Spielhofer via Qgis-user wrote:
> Hi,
> I have a set of similar layers where I would like to change certain 
> properties for all layers in the same way.
> * change opacity to 50%
> * change stroke style to "no pen"
> When I select multiple layers and open properties -> symbology, I just 
> change the styling of the first layer, not for all.
> Is there a way to do this?
> Regards,
> Roland
> 
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the Qgis-user mailing list