Hi Remi

On Thu, Feb 12, 2015 at 11:27 PM, Rémi Cura <[email protected]> wrote:

> Hello dear list,
>
> in  the process of developing a plugin (python 2.7, QGIS 2.6),
>
> from pyqgis ,
> we would like to refresh a Postgis layer.
> When using the vectorLayer.refresh(), it does nothing.
>

Try vectorLayer.triggerRepaint()

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.

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

Reply via email to