<div dir="ltr"><div><div><div><div><div><div><div><div>In the Documentation for QgsFeature<br><br><a href="http://qgis.org/api/2.14/classQgsFeature.html">http://qgis.org/api/2.14/classQgsFeature.html</a><br><br></div>It lists two methods for accessing the attributes<br><br>QVariant     attribute (const QString &name) const<br>QVariant     attribute (int fieldIdx) const<br><br></div>If I use the first method it works fine (ie feature.attribute('City')) , but the second (ie feature.attribute(0)) fails with the message<br><br>QgsFeature.attribute(QString): argument 1 has unexpected type 'int'<br><br></div>If instead I just use an index such as<br><br></div>feature[fieldIdx]<br><br></div>where feature is a QgsFeature, it works fine.<br><br></div>Am I missing something here or is the second 'attribute' method invalid?<br><br></div>Thanks,<br><br></div>Calvin<br></div>