I'm writing an application using the QML of the newly released Qt 5.2 targeted for Android. On one of the screens I need to display an article that is loaded from a server and may change after the application has been released. The article would be basically a block of text with images and some basic formatting (bold, italic, major source in section headings, etc). What is the best way to render this content?
The ideal would be to write in html and embed in a WebView
, but WebKit is not available for Android. Another option would be to write the article in QML and include using a Loader
. But it seems to be complicated by text with formatting and line breaking like this. One final way would be to create a C ++ class that exposes an interface to QML and has its own rendering mechanics. So it would be possible to use QTextDocument
and play on QPainter
.
What is the best way to do this? What are the problems with the ways I thought?