<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 1/25/15 8:22 PM, Martin Dobias
wrote:<br>
</div>
<blockquote
cite="mid:CAC2XbFetQW1JJ54u945hAiZt1=OOypcrqrQgE3RdPqnPiXcBdA@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Gary<br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Fri, Jan 23, 2015 at 5:52 AM, Gary
Sherman <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:gsherman@geoapt.com" target="_blank">gsherman@geoapt.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">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:<br>
<br>
lyr = iface.activeLayer()<br>
lyr.triggerRepaint()<br>
<br>
If I turn off caching in Settings, I don't have a problem
with my plugin.<br>
</blockquote>
<div><br>
</div>
<div>Which version of QGIS is that?</div>
</div>
</div>
</div>
</blockquote>
2.6<br>
<blockquote
cite="mid:CAC2XbFetQW1JJ54u945hAiZt1=OOypcrqrQgE3RdPqnPiXcBdA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<div>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.</div>
</div>
</div>
</div>
</blockquote>
Right, and that worked fine for me at 2.4.<br>
<br>
Thanks,<br>
<br>
-gary<br>
<blockquote
cite="mid:CAC2XbFetQW1JJ54u945hAiZt1=OOypcrqrQgE3RdPqnPiXcBdA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
</div>
<div>Cheers</div>
<div>Martin</div>
<div><br>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Gary Sherman
Founder, QGIS Project
Consulting: geoapt.com
Publishing: locatepress.com
We work virtually anywhere
=-=-=-=-=-=-=-=-=-=-=-=-=-=-= </pre>
</body>
</html>