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 nothing happens and
print (QgsLayerTree().hasCustomLayerOrder())
returns False. The API documentation
(https://qgis.org/pyqgis/master/core/QgsLayerTree.html) indicates that
customLayerOrder will only be used when hasCustomLayerOrder is True. I'm
missing something here but after browsing and googling, I just haven't
figured out how to make the change in rendering order active. Thanks.
_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to