QGIS Layer Tree API (Part 3)http://www.lutraconsulting.co.uk/blog/2015/01/30/qgis-layer-tree-api-part-3/