[Qgis-developer] Wierd issue with Python and triggerRepaint()

Gary Sherman gsherman at geoapt.com
Sun Jan 25 21:59:24 PST 2015


On 1/25/15 8:22 PM, Martin Dobias wrote:
> Hi Gary
>
> On Fri, Jan 23, 2015 at 5:52 AM, Gary Sherman <gsherman at geoapt.com 
> <mailto:gsherman at geoapt.com>> wrote:
>
>     I have a plugin that makes modifications to a memory layer, then
>     calls triggerRepaint() to refresh. Unfortunately, it doesn't
>     refresh the layer. If I open the Python console before making the
>     mods, it works from the console:
>
>     lyr = iface.activeLayer()
>     lyr.triggerRepaint()
>
>     If I turn off caching in Settings, I don't have a problem with my
>     plugin.
>
>
> Which version of QGIS is that?
2.6
>
> In QGIS < 2.4 you had to explicitly call lyr.clearCacheImage() if the 
> caching was turned on - otherwise the renderer would still use the 
> cached image stored in the layer's instance. Since 2.4 that is not 
> necessary anymore and triggerRepaint() should also clear renderer's 
> cached layer image.
Right, and that worked fine for me at 2.4.

Thanks,

-gary
>
> Cheers
> Martin
>

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Gary Sherman

Founder, QGIS Project
Consulting: geoapt.com
Publishing: locatepress.com

We work virtually anywhere
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150125/55c51ebf/attachment.html>


More information about the Qgis-developer mailing list