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

Martin Dobias wonder.sk at gmail.com
Wed Jan 28 09:27:34 PST 2015


Hi Gary

I cannot replicate your problem (tried 2.6 and master). I have attached a
very simple test plugin that first creates an layer and then adds a feature
on a click of a button. With the triggerRepaint() call the canvas is
refreshed correctly (when caching is enabled on or not). Let me know if
that code works for you - maybe your problem is somewhere else or it is
more complex.

Cheers
Martin


On Fri, Jan 23, 2015 at 5:52 AM, Gary Sherman <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.
>
> You rendering experts have any ideas?
>
> Thanks,
>
> -gary
>
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Gary Sherman
>
> Founder, QGIS Project
> Consulting: geoapt.com
> Publishing: locatepress.com
>
> We work virtually anywhere
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150129/dba6ce6c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: __init__.py
Type: text/x-python
Size: 1018 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20150129/dba6ce6c/attachment.py>


More information about the Qgis-developer mailing list