<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"><html><head><meta name="qrichtext" content="1" /><style type="text/css">p, li { white-space: pre-wrap; }</style></head><body style=" font-family:'Arial'; font-size:11pt; font-weight:400; font-style:normal;">On Saturday 21 February 2009 20:31:10 Aaron J. Seigo wrote:<br>
> On Saturday 21 February 2009, Toussis Manolis wrote:<br>
> > Thank you very much on answering my question.<br>
> ><br>
> > On Saturday 21 February 2009 18:34:27 Aaron J. Seigo wrote:<br>
> > > On Saturday 21 February 2009, Toussis Manolis wrote:<br>
> > > > I want to add some effect to an applet<br>
> > ><br>
> > > what effect are you trying to achieve? because while you ask how to get<br>
> > > a pixmap of your widget, depending on what effect you are trying to<br>
> > > achieve that may not be what you actually want to be doing.<br>
> ><br>
> > I was thinking of implementing a fadout effect of the old snapshot of the<br>
> > applet.<br>
> > I need the QPixmap to draw it with Opacity degrading from 1.0 to 0.0 ...<br>
><br>
> QGraphicsItem::setOpacity(qreal)<br>
><br>
> an easy way to achieve what you want is to implement the contents of your<br>
> applet as a QGraphicsWidget subclass (rather than painting directly into<br>
> your applet). make this child item non-movable and set its size to be the<br>
> same as your widget (can be done on SizeConstraint in constraintsEvent, or<br>
> you can override resizeEvent but be sure to call Applet::resizeEvent in<br>
> that case!).<br>
><br>
> then have two of these items; when doing the transition, show both but one<br>
> with a high opacity and the other with a the inverse value and adjust the<br>
> opacity on both. finally, hide or delete the one that is "going away".<br>
> voila.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>You are right about using QGraphicsWidgets to draw my applet.<br>
It could be much easier to implement the graphics placement/drawing/animation.<br>
I will use it next time.<br>
For the specific applet I wrote it from the beginning with drawing over it, and it is not such a big project to re implement it , the clean way. :-)<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p>Thanks again for the proposals.<br>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p><p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br></p></body></html>