Re: [Qgis-developer] Qgis Api - select all features of a vector layer

2010-11-09 Thread Barry Rowlingson
On Tue, Nov 9, 2010 at 4:22 PM, kimaidou kimai...@gmail.com wrote: Hi again Still working on my python plugin... I need to simply select all the features of a chosen vector layer. In QgsVectorLayer api, there is no method selectAllFeatures() So I use this piece of code to achieve it

Re: [Qgis-developer] Qgis Api - select all features of a vector layer

2010-11-09 Thread kimaidou
2010/11/9 Barry Rowlingson b.rowling...@lancaster.ac.uk That's an interesting approach! My selectplus plugin has a 'select all' function which does this: I love coding : there is never one way to achieve things :) def doit(self): layer = self.iface.mapCanvas().currentLayer()

[Qgis-developer] Qgis Api - select all features of a vector layer

2010-11-09 Thread kimaidou
Hi again Still working on my python plugin... I need to simply select all the features of a chosen vector layer. In QgsVectorLayer api, there is no method selectAllFeatures() So I use this piece of code to achieve it http://osgeo.pastebin.com/Ma9DxgKR * Is there a better way to do so ? * Do

Re: [Qgis-developer] Qgis Api - select all features of a vector layer

2010-11-09 Thread kimaidou
Thanks for this answer 2010/11/9 Carson Farmer carson.far...@gmail.com ...and with the newer PyQGIS API, we can do things even more Pythonically: Is the new api usable from 1.5, or should I wait for the next version ? def layerIds(layer): layer.select([]) # we don't actually need the