[QGIS-Developer] FeatureIterator Python question

Andreas Neumann a.neumann at carto.net
Fri Sep 15 05:43:53 PDT 2017


Hi,

While porting a project from QGIS 2x to 3x I came across a Python issue:

In QGIS 2.x I had a code like below working:

feature = FeatureIterator.next()

In QGIS 3x it says that object has no attribut next.

How do I access the first result of a feature iterator in QGIS 3?

I don't want to loop, because I know that my FeatureIterator always has 
just one result. I just want to access this first feature.

Thanks for your help,

Andreas



More information about the QGIS-Developer mailing list