Hi Marco,

Thanks for your reply.

I think this is suposed to work since __setitem__ is defined in the sip file [0]

[0] https://github.com/qgis/Quantum-GIS/blob/master/python/core/qgsfeature.sip#L62



On 05/06/2013 11:47 AM, Marco Bernasocchi wrote:

hi denis I dont have the new api completely in mind, but maybe this [0]
can help you.

[0] http://lists.osgeo.org/pipermail/qgis-developer/2013-February/024278.html

Marco Bernasocchi (mobile)
http://opengis.ch

On May 6, 2013 11:27 AM, "Denis Rouzaud" <denis.rouz...@gmail.com <mailto:denis.rouz...@gmail.com>> wrote:

    Hi all,

    I got a crash when I did this:

    fields = layer.dataProvider().fields()
    f = QgsFeature()
    f.setFields(fields)
    for field in fields:
        f[field.name <http://field.name>()] = QVariant("1")

    Using QVariant or not.

    What did I (again) did wrong ????

    Greetings,

    Denis
    _______________________________________________
    Qgis-developer mailing list
    Qgis-developer@lists.osgeo.org <mailto:Qgis-developer@lists.osgeo.org>
    http://lists.osgeo.org/mailman/listinfo/qgis-developer


_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to