Hey Martin, thanks for the answer (again !) Apparently it still doesn't refresh anything. When I do it manually I use the "Refresh" button, and this works. (The zoom trick also works)
Could it be because the layer needing refresh are not only the active layer but all the others? Cheers, Rémi-C 2015-02-12 17:42 GMT+01:00 Martin Dobias <[email protected]>: > 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
