title: qt draw colorful text
body: <p>I use QPainter to drawText on QPrinter; however, there is a problem. I hope I can draw a colorful text. For example, drawing "Hello World" where the "H" is green, "ello" is yellow, "World" is blue.<br>
    For the time being, I call drawText 3 times and using different QPen to change color. Moreover, I must calculate the position where to draw at 3 times. Finally, I couldn't align a string in a QRect because I don't draw a complete sentence. Is there a way to solve it with a simple way? Any hint is appreciated! Thanks!  </p>