Have a look on setFormat method, and also the QTextCharFormat class..

http://doc.trolltech.com/4.3/qtextta...html#setFormat
http://doc.trolltech.com/4.3/qtextcharformat.html

In QTextCharFormat, you have a method 'setVerticalAlignment'