I have an image like this:
I have a custom widget that reimplements paintEvent()
.
On top of the image I’d like to draw an overlay with one or more rectangles spared out. With rounded corners and proper anti-aliasing.
I’m guessing this might be possible with QPainter::CompositionMode. But how? Maybe draw the overlay into a QImage? Invert it?
In paint.net I drew a rectangle into a second layer, then selected the inside with the magic wand, and deleted it. I don’t know how to do that with QPainter.