[Qgis-developer] QgsFields has not method values()

Gino Pirelli luipir at gmail.com
Sun Jul 28 03:50:39 PDT 2013


Hi

what was the result of QgsFields.values()? I've no documentation in
master and in 1.8!

I've this error in a plugin:

 File "/home/ginetto/.qgis2/python/plugins/rt_postgres_extractor/WizPage1.py",
line 187, in fillLayerAttrsCombo
    self.layerAttrsCombo.addItems(  self.getFieldNames4Combo(flds.values()) )
AttributeError: 'QgsFields' object has no attribute 'values'

from this code:

pr = layer.dataProvider()
flds = pr.fields()
self.layerAttrsCombo.addItems(  self.getFieldNames4Combo(flds.values()) )

where layer is a QgsVectorLayer => pr is a QgsVectorDataProvider

ciao ginetto


More information about the Qgis-developer mailing list