Hi Martin,<br><br>I solve the problem of pixmap visualization using the correct icon dimension (setIconSize () )<br>but I don&#39; t understand how to use boundingRect() and... which boundingRect() method----<br><br><br>Luca<br>
<br><div class="gmail_quote">2009/7/2 Martin Dobias <span dir="ltr">&lt;<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Thu, Jul 2, 2009 at 11:43 AM, Luca Pascale&lt;<a href="http://pascale.luca.it" target="_blank">pascale.luca.it</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>&gt; wrote:<br>
&gt; [...]<br>
<div class="im">&gt;     case ICON_CUSTOM:<br>
&gt;<br>
&gt;       QPixmap pixmap(QSize(22,22));<br>
&gt;       pixmap.load(mFileName);<br>
&gt;       p-&gt;drawPixmap(0,0,pixmap);<br>
&gt;       break;<br>
<br>
</div>It would be wiser to load the pixmap just once and keep the QPixmap,<br>
it will save some time when doing updates. Additionally, you don&#39;t<br>
have to set pixmap&#39;s size before the load() method - the pixmap will<br>
be resized to the required size during the load.<br>
<div class="im"><br>
&gt; The problem now is that the icon (png file) is not plotted correctly until I<br>
&gt; refresh the map canvas.<br>
&gt; See the attached images.<br>
&gt; notcorrectvisualization.png is what I obtain on the screen<br>
&gt; and<br>
&gt; correctvisualization.png is waht I obtain after pushed the refresh button.<br>
&gt;<br>
&gt; Any suggestion to solve ??<br>
<br>
</div>Yes: you have to update boundingRect() function to return correct<br>
rectangle of the marker. Currently for markers it&#39;s something like<br>
(-5,-5)..(5,5) while you probably want a bounding rect e.g.<br>
(0,0)..(22,22). But think also where dou you actually want to put the<br>
pixmap - currently you draw it in a way that the position is at the<br>
upper left corner of the pixmap. Maybe you want it to be in the<br>
center...?<br>
<font color="#888888"><br>
Martin<br>
</font></blockquote></div><br><br clear="all"><br>