You can set logical drawing ops if you're drawing over a QImage; see QPainter::setCompositionMode. XOR mode is not longer available for ordinary drawing; the rationale is that modern graphics engines are so fast that there is no downside to simply caching the original background and drawing on top of it. This also makes color rendering more sane.
I'm not sure I agree with this, but it's the technique used in Qwt for rubberbanding.
Bookmarks