<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="Generator" content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Texte de bulles Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.TextedebullesCar
{mso-style-name:"Texte de bulles Car";
mso-style-priority:99;
mso-style-link:"Texte de bulles";
font-family:"Tahoma","sans-serif";
mso-fareast-language:EN-US;}
span.EmailStyle19
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.EmailStyle20
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style></head><body lang="FR" link="#0563C1" vlink="#954F72"><div class="WordSection1"><p class="MsoNormal"><span lang="EN-US" style="color:#1f497d">Thank you Sylvain for you answer,you are right. I realise that if I show the window after loading the shape file, the canvas has not the right dimensions.</span></p>
<p class="MsoNormal"><span lang="EN-US" style="color:#1f497d">Have a nice day,</span></p><p class="MsoNormal"><span lang="EN-US" style="color:#1f497d">Sylvie</span></p><p class="MsoNormal"><span lang="EN-US" style="color:#1f497d"> </span></p>
<div><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal"><b><span style>De :</span></b><span style> PIERRE Sylvain [mailto:<a href="mailto:sylvain.pierre@cg67.fr">sylvain.pierre@cg67.fr</a>] <br>
<b>Envoyé :</b> jeudi 20 mars 2014 15:55<br><b>À :</b> Sylvie Perdriel; <a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a><br><b>Objet :</b> RE: [Qgis-user] Problem refreshing map canvas with pyqgis</span></p>
</div></div><p class="MsoNormal"> </p><p class="MsoNormal"><span lang="EN-US" style="color:#1f497d">May-be you’d better show first the window, load the layer and refresh the canvas NOT the window</span></p><p class="MsoNormal">
<span lang="EN-US" style="color:#1f497d"> </span></p><p class="MsoNormal"><span lang="EN-US" style="color:#1f497d">Sylvain</span></p><p class="MsoNormal"><span lang="EN-US" style="color:#1f497d"> </span></p><p class="MsoNormal">
<span style="color:#1f497d"> </span></p><div><p class="MsoNormal"><span style="color:#1f497d"> </span></p></div><p class="MsoNormal"><span style="color:#1f497d"> </span></p><div><div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> <a href="mailto:qgis-user-bounces@lists.osgeo.org">qgis-user-bounces@lists.osgeo.org</a> [<a href="mailto:qgis-user-bounces@lists.osgeo.org">mailto:qgis-user-bounces@lists.osgeo.org</a>] <b>De la part de</b> Sylvie Perdriel<br>
<b>Envoyé :</b> jeudi 20 mars 2014 14:24<br><b>À :</b> <a href="mailto:qgis-user@lists.osgeo.org">qgis-user@lists.osgeo.org</a><br><b>Objet :</b> [Qgis-user] Problem refreshing map canvas with pyqgis</span></p></div></div>
<p class="MsoNormal"> </p><p class="MsoNormal"><span lang="EN-US">Hello Every Body,</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal"><span lang="EN-US">I’d like to develop a standalone application for air pollution modeling based on pyqgis. I installed QGIs version 2.2 on windows 7 64bits from osgeo installer and my development platform is Eclispe/pydev.</span></p>
<p class="MsoNormal"><span lang="EN-US">As a first step, I’m trying to load a shapefile and plot it on a qgsmapcanvas (see attached python code) : the shapefile is properly loaded but I can see it plotted only after minimizing the window and restoring it. I have tried to add repaint(), refresh() calls on the qgsmapcanvas or the window without any success. I must surely miss something simple and would appreciate some help if possible.</span></p>
<p class="MsoNormal"><span lang="EN-US">Thank you in advanced and best regards,</span></p><p class="MsoNormal"><span lang="EN-US"> </span></p><p class="MsoNormal">Sylvie</p><p class="MsoNormal"> </p></div></body></html>