Hi, I'm able to create a new rule based labeling setup from scratch like this minimal example :
root = QgsRuleBasedLabeling.Rule(QgsPalLayerSettings()) settings = QgsPalLayerSettings() rule = QgsRuleBasedLabeling.Rule(settings) root.appendChild(rule) rules = QgsRuleBasedLabeling(root) myLayer.setLabeling(rules) Unfortunately I can't find how to iterate over existing rules, the labeling() <http://python.qgis.org/api/core/Vector/QgsVectorLayer.html?#qgis.core.QgsVectorLayer.labeling> method available for vector layers return an object of QgsAbstractVectorLayerLabeling <http://python.qgis.org/api/core/Abstract/QgsAbstractVectorLayerLabeling.html> class but it seems there is no way to get the root rule ( QgsRuleBasedLabeling <http://python.qgis.org/api/core/Rule/QgsRuleBasedLabeling.html>) from this class. The only possibility I found is to get directly pal settings using providers ids but I can't access to rules tree. Anyone have a clue ? Thanks in advance for any help
_______________________________________________ QGIS-Developer mailing list [email protected] List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
