I have loaded multiples duplicated layers in Qgis with different filters. I wonder if it is possible to find the layers that haven't any filter(setSubsetString method) with Pyqgs ?


Loop over all registered layers and check if subsetString is empty.

layers = QgsMapLayerRegistry.instance().mapLayers()
for name, layer in layers.items():
    if not layer.subsetString():
        print 'layer %s has empty subsetString'% name
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.