Trolltech Home | QSA-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

QSA-interest Archive, December 2007
overlap of QIcon with image


Message 1 in thread

<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV></DIV>
<DIV><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2>I need to display the below UI.</FONT></SPAN></DIV>
<DIV><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=202074013-17122007>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2>Lets assume Gray color box is QIcon Widget, which is loaded with a Gray color image. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2>And Red color rectangle is transparent icon which is drawn to overlap the QIcon widget.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV></SPAN></DIV>
<DIV><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2>Fig (1): I need the below UI. </FONT></SPAN><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2></FONT></SPAN></DIV>
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2><IMG src="cid:1.3050665456@xxxxxxxxxxxxxxxxxxxxxxxxxxx";></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2>Fig(2): If i draw red icon using painter.drawPixmap then i am getting the below UI.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=202074013-17122007><FONT face=Verdana color=#0000ff size=2></FONT></SPAN>&nbsp;<SPAN class=202074013-17122007><IMG src="cid:2.3050665457@xxxxxxxxxxxxxxxxxxxxxxxxxxx";></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV>Basically I need to set QIcon widget / QIcon loaded image to be transparent. So that the red color rectangle can be visible on top of QIcon Widget .</DIV>
<DIV>&nbsp;</DIV>
<DIV>I tried </DIV>
<DIV>&nbsp;</DIV>
<DIV>Approach(1): In QIcon paintEvent handler function.</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; QGfx * gfx = painter-&gt;internalGfx();<BR>&nbsp;&nbsp;&nbsp; unsigned int oldType = gfx-&gt;overlayTransparentType();<BR>&nbsp;&nbsp;&nbsp; gfx-&gt;setOverlayTransparentType(0);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; painter-&gt;drawPixmap (xPos, yPos, *pixmap);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; gfx-&gt;setOverlayTransparentType(oldType); <BR></DIV>
<DIV>
<DIV>Before drawing i called setOverlayTransparentType. But this doesn't solved the problem.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Does anyone can help me&nbsp;on this ? Basically I could like to know How do I overlap QIcon loaded image &amp; Icon&nbsp;?</DIV></DIV>
<DIV align=left><FONT face=Verdana color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV align=left>Thanks &amp; Regards,</DIV>
<DIV align=left>P.Sriniamul</DIV></DIV><BR></DIV></div><br>


      <!--4--><hr size=1></hr> 5, 50, 500, 5000 - Store N number of mails in your inbox. <a href="http://in.rd.yahoo.com/tagline_mail_4/*http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html/";>Click here.</a></body></html>

JPEG image

JPEG image