I have a vector layer in qgis. I have added a bunch of rule for this layer. This is the QDockWidget for layer in QGIS main window
So each of interstate, divided, secondary is different rule added using QgsRuleBasedRendererV2
All the rule have the check box where i can manually toggle the visibility of the layer. Is there any way i can toggle this using python.
I tried to use layer tree
root = QgsProject.instance().layerTreeRoot() for child in root.children(): print type(child), child.layerName(), child.children() but child.children is returning empty list instead of those rules.
type of Road Network is qgis._core.QgsLayerTreeLayer
أكثر...

So each of interstate, divided, secondary is different rule added using QgsRuleBasedRendererV2
All the rule have the check box where i can manually toggle the visibility of the layer. Is there any way i can toggle this using python.
I tried to use layer tree
root = QgsProject.instance().layerTreeRoot() for child in root.children(): print type(child), child.layerName(), child.children() but child.children is returning empty list instead of those rules.
type of Road Network is qgis._core.QgsLayerTreeLayer
أكثر...