[Qgis-developer] refresh postgis layer

Rémi Cura remi.cura at gmail.com
Thu Feb 12 08:27:39 PST 2015


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.

We used a trick that works but seems like a bad idea :
(we slightly change the zoom to force rendering)
DEFAULT_SEGMENT_EPSILON = 1E-8
mapCanvas().zoomByFactor(1.0 + DEFAULT_SEGMENT_EPSILON, mapRect.center())

Somebody knows how to do it properly?
Thanks,
Rémi-C
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150212/d7bb9a23/attachment.html>


More information about the Qgis-developer mailing list