Have a look at QPainter::setCompositionMode.
Have a look at QPainter::setCompositionMode.
Thanks numbat for the quick reply. I tried QPainter::setCompositionMode with most of the options but it dint worked well. Can you suggest me how should I try with QPainter::setCompositionMode as it dint worked to draw new line with inverted background color.
Thanks and Regards
J.Viswanath
Try this:
QPainter *painter;
painter->setCompositionMode(QPainter::RasterOp_SourceXorDe stination);
painter->setPen(QColor(0xFF,0xFF,0xFF));
painter->drawLine(x1, y1, x2, y2);
Cheers,
mrhill
--
Datahammer 7yuv - the hex editor and raw image data viewer built with QT
By far the easiest way to do this is not to do tricks with pen modes. Simply create a widget with a transparent background on top of the widget you want to draw the rubber band on, and draw it with whatever pen want in ordinary drawing mode. Each time the mouse moves, call update(), the window will be erased, and then you draw the new line. When you want to stop using the rubber band, just "hide" the rubber band window.
Bookmarks