<div><font>Hi Andreas,<br></font></div><div><font><br></font></div><div><font>layer.setSubsetString( subsetString ) seems the way to go. At least that's what I use in Time Manager ;)<br></font></div><div><font><br></font></div>
<div><font>Best wishes,<br></font></div><div><font>Anita<br></font></div><div><font><br></font></div><br><div class="gmail_quote">On Wed, Jun 20, 2012 at 4:49 PM, Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
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.<br>
<br>
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?<br>
<br>
Thanks if you have any ideas or even sample code on how to achieve this.<span class="HOEnZb"><font color="#888888"><br>
<br>
Andreas<br>
<br>
-- <br>
--<br>
Andreas Neumann<br>
Böschacherstrasse 10A<br>
8624 Grüt (Gossau ZH)<br>
Switzerland<br>
_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
</font></span></blockquote></div><br>