EDIT:
Right I saw that you wrote a post. Yes, probably QTextDocument will be the more flexible way. Do consider the code sample I give you here though.
Kind regards.
Thank you very much for this, I will definitely try it!
What about painting a partially transparent rectangle over the part of the text that should be highlighted ? You could draw the text first and then the rectangle over.