[Qgis-developer] refresh postgis layer

Rémi Cura remi.cura at gmail.com
Thu Feb 12 09:19:33 PST 2015


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 <wonder.sk at gmail.com>:

> Hi Remi
>
> On Thu, Feb 12, 2015 at 11:27 PM, Rémi Cura <remi.cura at gmail.com> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150212/531f97e3/attachment.html>


More information about the Qgis-developer mailing list