I have some Python code to get the ids and georeference from a shapefile:
canvas = qgis.utils.iface.mapCanvas()
allLayers = canvas.layers()
nos = QgsFeature()
for i in allLayers:
if i.name()=='path_nodes':
path_nodes = i
nodedata = path_nodes.dataProvider()
while nodedata.nextFeature(nos):
i = i + 1
print str(no.gid())
It does not return all of the ids. Can anyone help?