I have a project which has dozens of groups and subgroups. E.g.:
Main_Group > Sub_Group_1 > Sub_Group_1A > Layer_1A > Layer_2A
How can I access those layers which are contained within
I currently have this:
root = QgsProject.instance().layerTreeRoot() for child in root.children(): if isinstance(child, QgsLayerTreeGroup): if child.name() == "Main_Group": for subChild in child.children(): if isinstance(subChild, QgsLayerTreeGroup): if subChild.name() == 'Sub_Group_1': # What next?
I have read through the following sources and can get layers in
Sub_Group_1 but not in