[Qt-interest] Images in QTextDocuments

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Thu Apr 7 04:35:24 CEST 2011


Hi Wilhelm, 

Have a look at QTextBlock::next() - you can navigate all blocks in one loop,
without having to do the recursive frame stuff.  

Hope that helps, 

Tony.



> -----Original Message-----
> Sent: Wednesday, 6 April 2011 23:55 PM
> 
> 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.




More information about the Qt-interest-old mailing list