Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
Take a look at the C++ GUI Programming with Qt 4 book, there's a chapter dedicated to document creation and printing that should give you a good overview of what is possible. Even if for a Qt 4, there are still relevant stuff for Qt 5 in there.