Can anyone help me how to iterate through features using a Field as a sort 
order?

 

I saw that there is a function  
<https://qgis.org/api/classQgsFeatureRequest.html#ad9c11d4c88185fcfb0a54f8703699717>
 setOrderBy on QgsFeatureRequest, by it seems to request a OrderBy Class 
argument, but I could not get how to use it.

 

Simple example:

"

lyr = iface.activeLayer()

prov = lyr.dataProvider()

for feature in prov.getFeatures(QgsFeatureRequest()):

    print feature.id()

"

 

Thank you

_______________________________________________
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to