Re: [QGIS-Developer] How to turn on CustomLayerOrder (PyQGIS)

2024-10-25 Thread coder via QGIS-Developer
Hi David, It's finally working! Thank you (and sorry for the delay in getting back to you). AF David Signer wrote: First you have to retrieve the current layertree to do modifications: tree = QgsProject.instance().layerTreeRoot() ...and after setting your order: tree.setCustomLayerOrder(layersII)

Re: [QGIS-Developer] How to turn on CustomLayerOrder (PyQGIS)

2024-10-24 Thread David Signer via QGIS-Developer
First you have to retrieve the current layertree to do modifications: tree = QgsProject.instance().layerTreeRoot() ...and after setting your order: tree.setCustomLayerOrder(layersII) ...you have to set that a layer order should be considered: tree.setHasCustomLayerOrder(True) On Wed, Oct 23, 2024

Re: [QGIS-Developer] How to turn on CustomLayerOrder (PyQGIS)

2024-10-23 Thread Catania, Luke A ERDC-RDE-GRL-VA CIV via QGIS-Developer
order.insert(0, order.pop(order.index(layer))) root.setCustomLayerOrder(order) layer.triggerRepaint() root.setHasCustomLayerOrder(False) From: QGIS-Developer On Behalf Of coder via QGIS-Developer Sent: Wednesday, October 23, 2024 11:05 AM To: qgis-developer@lists.osgeo.org Su

[QGIS-Developer] How to turn on CustomLayerOrder (PyQGIS)

2024-10-23 Thread coder via QGIS-Developer
Hello I'm trying to change the rendering order for the layers in the canvas with the aid of QgsLayerTree. The code grabs each layer, checks whether is a QgsMapLayer instance, and generates a reordered list (layersII). Then, the code executes: QgsLayerTree().setCustomLayerOrder(layersII) but nothin