What is the painter object working on? Is it a pixmap, a widget or what?
What is the painter object working on? Is it a pixmap, a widget or what?
painter works on QImage.
Why don't you just create an empty QImage and draw on that instead of clearing the one you have?
In my case, I have to update the image every serveral milliseconds, only part of the image should be erased and repainted. so I think create a new QImage is infeasible.
In that case you should indeed use Clear composition mode.
rolandsun (13th June 2012)
Finally QPainter::CompositionMode_Source works ,thanks.
Bookmarks