<html><head></head><body><div>
<div dir="auto" id="compose-body-wrapper"><div dir="auto"><div
dir="auto">Hello</div><div dir="auto">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:</div><div
dir="auto">
QgsLayerTree().setCustomLayerOrder(layersII)</div><div dir="auto">but
nothing happens and</div><div dir="auto"> print
(QgsLayerTree().hasCustomLayerOrder()) </div><div dir="auto">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.
</div><div><br></div></div></div>
</div></body></html>