I would like to create a small text processor, with functionality roughly the same as the one in Google docs. While it's easy to use QTextEdit, especially with the given examples, I find it quite hard to start adding formatting options. I tried downloading some larger examples like KWord or some example apps from trolltech website, but they are either very large and quite hard to comprehend or they aren't providing the same functionality (like LaTeX based WYSIWYG editor).

Could you point into some direction with this? Maybe you know some good examples on how to achieve this and build some simple (like having bold, italic and underline, font size and maybe type) text processor? I would be very thankful for your help.