I need to be able to clip my canvas to a given rectangle. I tried sub-classing from the QCanvas widget and added my own virtual functions for drawForeground and drawBackground. I then tried to set clipping on and set a clip rect for the painter in both functions, which didn't work.
So then I tried to just add a return statement at the top of both functions, but the foreground always gets painted.
Can someone tell me what I am doing wrong, and more importantly, why is it drawing anything at all when I am just returning from the draw functions?