Select Features when editing (python)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Select Features when editing (python)

Fred Lehodey
Hi,

to select postgis features, I'm using something like:
s = myLayer.getFeatures(QgsFeatureRequest().setFilterExpression(u'id=%s'%feat_id))
for f in s:
     myLayer.setSelectedFeatures([f.id()])

Works fine with existing features.
How to do the same, during editing session of postgis layer, with new features having temporary negative ids ?

Thanks.
Regards
Fred.


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer