[Qgis-developer] Merging of incompatible changes

Martin Dobias wonder.sk at gmail.com
Sat Oct 27 12:45:45 PDT 2012


On Sat, Oct 27, 2012 at 7:37 PM, Tim Sutton <lists at linfiniti.com> wrote:
>>>
>>>     while myProvider.nextFeature(myFeature):  # or equivalent in new api
>>>         myGeometry = myFeature.geometry()
>>>         myFooValue = myFeature['foo']
>>>         .... do stuff .....
>>
>> Good news, that's on the branch already ;-)
>
> Wohooo! Does that work for C++ api too?

For now the support for attribute fetching by field name is like this:
value = feature.attribute("foo");
But I guess there's no problem to implement operator[], too:
value = feature["foo"];

Martin


More information about the Qgis-developer mailing list