<div><font>Yes, I call<br></font></div><div><font><br></font></div><div><font>self.iface.mapCanvas().refresh() <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 5:25 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">Thanks Anita - easier than I thought.<br>
<br>
Apparently one has to refresh the canvas after setting the subsetString.<br>
<br>
Is that how you do it in Time Manager?<br>
<br>
Thanks,<br>
Andreas<div class="im"><br>
<br>
On Wed, 20 Jun 2012 17:04:49 +0200, Anita Graser wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi Andreas,<br>
<br>
layer.setSubsetString( subsetString ) seems the way to go. At least<br>
that's what I use in Time Manager ;)<br>
<br>
Best wishes,<br>
<br>
Anita<br>
<br></div>
On Wed, Jun 20, 2012 at 4:49 PM, Andreas Neumann wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Hi,<br>
<br>
For an existing layer I would like to add/change/remove the WHERE<br>
filter by script - the same that one would normally set by the query<br>
builder.<br>
<br>
Do I need to change the QgsDataSourceURI() of that QgsVectorLayer<br>
and then reload it or is there an easier/more elegant way to change<br>
the filter of an existing layer?<br>
<br>
Thanks if you have any ideas or even sample code on how to achieve<br>
this.<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>
</div><a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a> [1]<br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a> [2]<br>
</blockquote>
<br>
<br>
<br>
Links:<br>
------<br>
[1] mailto:<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
[2] <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
[3] mailto:<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a><br>
</blockquote><div class="HOEnZb"><div class="h5">
<br>
-- <br>
--<br>
Andreas Neumann<br>
Böschacherstrasse 10A<br>
8624 Grüt (Gossau ZH)<br>
Switzerland<br>
</div></div></blockquote></div><br>