PDA

View Full Version : Any option for QPainter::setRasterOp( ) in Qt 4.2.2



joseph
30th April 2007, 06:49
Hi guys,

Our team is trying to port our application from qt3.4.4 to Qt 4.2.2. The existing one is a drawing application ( Qt3.3.4) , which will draw objects ( say Line, rectangle..etc ) in Qframe.and everything is wroking perfectly in Qt3.x.

Now the problem is, in Qt3.x we were using
Qpainter::setRasterOp( )
to get a clear drawned object . but while poting to Qt 4.2.2 , there is no such option like "setRasterOp( )"

Could you please let me know any option to enable " RasterOperation " in Qt 4.2.2 .

marcel
30th April 2007, 07:09
You can take a look at QPainter::setCompositionMode().
Note that it only works when the paint device is a QImage. More info in Assitant.

Regards

Uwe
30th April 2007, 07:32
There is no replacement for the XOR mode in Qt4. Whatever solution you like to implement in Qt4, erasing of the lines, rectangles (rubberbands) always needs a repaint of the widget !

And yes, the performance is worse and it might be difficult to get things flicker free. As an example you might have a look at http://qwt.sf.net. F.e. in the bode example you can see a rubberband in action with Qt4.

HTH,
Uwe