[Qt-interest] Images in QTextDocuments

Wilhelm wilhelm.meier at fh-kl.de
Wed Apr 6 15:54:36 CEST 2011


Am 06.04.2011 12:33, schrieb Andreas Pakulat:
> On 06.04.11 08:49:56, Wilhelm wrote:
>> Hi,
>>
>> is it posible to give images in QTextDcouments a somehow "textual
>> representation"?
> 
> No, that goes against the definition of toPlainText. Your only option is
> parsing the HTML yourself and extracting the text from that.

Well, that was my guess - sadly.

Now I solved this issue by traversing the QTextDocument structure from
the rootFrame recursively. Then every QTextFragment which holds an image
is queried for some textual representation. I think that is more generic
than the parse-html-suggestion.

> 
> Andreas
>  
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest


-- 
Wilhelm




More information about the Qt-interest-old mailing list