Sort the layer order from code: can this be done?

I was wondering if I can specify the order in which a (sub) layer appears in the layer manager in code somewhere?

No, I don’t believe so. Why do you want or need to do this?

When I add a sublayer from code it is added to the end of the list, even when I want it somewhere else because of a domain-specific sort order.
Could this be added as a feature request? Thanks

Hi Dale,

I have a similar problem.
When my plugin add new layers. It will appear to be at the bottom of the Layers panel list.

Is there some way to invoke a sort / reorder to the Layers Panel.