Hi Martin,<br><br>I solve the problem of pixmap visualization using the correct icon dimension (setIconSize () )<br>but I don' 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"><<a href="http://wonder.sk">wonder.sk</a>@<a href="http://gmail.com">gmail.com</a>></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<<a href="http://pascale.luca.it" target="_blank">pascale.luca.it</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:<br>
> [...]<br>
<div class="im">> case ICON_CUSTOM:<br>
><br>
> QPixmap pixmap(QSize(22,22));<br>
> pixmap.load(mFileName);<br>
> p->drawPixmap(0,0,pixmap);<br>
> 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't<br>
have to set pixmap's size before the load() method - the pixmap will<br>
be resized to the required size during the load.<br>
<div class="im"><br>
> The problem now is that the icon (png file) is not plotted correctly until I<br>
> refresh the map canvas.<br>
> See the attached images.<br>
> notcorrectvisualization.png is what I obtain on the screen<br>
> and<br>
> correctvisualization.png is waht I obtain after pushed the refresh button.<br>
><br>
> 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'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>