<div dir="ltr"><div>Hey Martin,</div><div>thanks for the answer (again !)</div><div><br></div>Apparently it still doesn't refresh anything.<div>When I do it manually I use the "Refresh" button, and this works.</div><div>(The zoom trick also works) </div><div><br></div><div>Could it be because the layer needing refresh are not only the active layer but all the others?</div><div><br></div><div>Cheers,</div><div>Rémi-C</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-02-12 17:42 GMT+01:00 Martin Dobias <span dir="ltr"><<a href="mailto:wonder.sk@gmail.com" target="_blank">wonder.sk@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Remi<div><br></div><div class="gmail_extra"><div class="gmail_quote"><span class="">On Thu, Feb 12, 2015 at 11:27 PM, Rémi Cura <span dir="ltr"><<a href="mailto:remi.cura@gmail.com" target="_blank">remi.cura@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello dear list,<div><br></div><div>in  the process of developing a plugin (python 2.7, QGIS 2.6),</div><div><br></div><div>from pyqgis ,</div><div>we would like to refresh a Postgis layer.<br>When using the vectorLayer.refresh(), it does nothing.</div></div></blockquote><div><br></div></span><div>Try vectorLayer.triggerRepaint()</div><div><br></div><div>Calling refresh() of the canvas will not work because even though the canvas will get refreshed, it will use previously cached map images. With triggerRepaint() the cached map image of your layer will get cleared and also refresh() will be called for any canvas that displays such layer.</div><div><br></div><div>Regards</div><span class="HOEnZb"><font color="#888888"><div>Martin</div><div><br></div></font></span></div></div></div>
</blockquote></div><br></div>