I'm trying to adapt my plugin (multipart
split<http://plugins.qgis.org/plugins/splitmultipart/>)
to work in the master version 1.9. at some point in my code I had something
like this:

...
new_attributes = layer.pendingFields()

        for j in range(new_attributes.__len__()):
            if provider.defaultValue(j).isNull():
                if QGis.QGIS_VERSION_INT < 10900:
                    new_attributes[j] = feature.attributeMap()[j]
                else:
                    new_attributes[j] = feature.attributes()[j]
            else:
                new_attributes[j] = provider.defaultValue(j)
...

But when using it in 1.9 I got the following error in the line:
new_attributes[j] = feature.attributes()[j]

Traceback (most recent call last):
  File "<input>", line x, in <module>
TypeError: QgsFields.__setitem__(): argument 2 has unexpected type
'QVariant'


Any advice is welcome.

Best regards,

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

Reply via email to