Hi Andreas, layer.setSubsetString( subsetString ) seems the way to go. At least that's what I use in Time Manager ;)
Best wishes, Anita On Wed, Jun 20, 2012 at 4:49 PM, Andreas Neumann <[email protected]>wrote: > Hi, > > For an existing layer I would like to add/change/remove the WHERE filter > by script - the same that one would normally set by the query builder. > > Do I need to change the QgsDataSourceURI() of that QgsVectorLayer and then > reload it or is there an easier/more elegant way to change the filter of an > existing layer? > > Thanks if you have any ideas or even sample code on how to achieve this. > > Andreas > > -- > -- > Andreas Neumann > Böschacherstrasse 10A > 8624 Grüt (Gossau ZH) > Switzerland > _______________________________________________ > Qgis-developer mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/qgis-developer >
_______________________________________________ Qgis-developer mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/qgis-developer
