This is another attempt that overrides the paintEvent to do the same thing.
mentioned in commit a4e415bd
mentioned in commit bbfa7ee9