I solved it.
The problem was the rect I passed to the paintEvent. It must completely contain the 2 lines ( old and new ). Something like this
Qt Code:
  1. QRect r = QRect( old_line - 1, 0, new_line + 1, height() )
To copy to clipboard, switch view to plain text mode 
and pass r to the paintevent
Qt Code:
  1. update( r )
To copy to clipboard, switch view to plain text mode 

Regards,
Franco