Did you try compiling this code? IMO it won't compile.

You need to call the base class implementation in the paint event, that's for sure.