You also could try
Qt Code:
  1. setAutoFillBackground ( true );
To copy to clipboard, switch view to plain text mode 
on the editor widget if implementing paintEvent() is not needed for other stuff.