Hi all,

I try to add a feature in a layer with only one field (over a few in the layer) filled.

Here is what I tried:

f = QgsFeature()
f.setGeometry(myGeom)
f.setAttribute(1, myValue)
provider.addFeatures( [f] )

This causes QGIS to crash.

What did I wrong? I should not set field 1 if there is a field 0 in my feature?
Should I set the same number of fields as present in the layer?
Is there another way to achieve this?

Thanks a lot,

Denis




_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to