[Qt-interest] QTextDocument/QTextCursor: process formatted text including newlines(!) ?

Girish Ramakrishnan girish at forwardbias.in
Mon Jun 29 05:01:16 CEST 2009


noname wrote:
> hi,
> i have some troubles processing a QTextDocument (to bring the contents
> to another format).
> i need to get the formatted text, so i'm using QTextCursor, which is
> working fine, except that all the newlines ('\n')
> are gone (they are converted to QChar::ParagraphSeparator afaik).
> so, is there a way to get the formatted content (including frames,
> tables, lists, etc.) of a QTextDocument _with newlines_?
> 

QTextCursor is the 'editing' api. For iterating, have you read
http://doc.trolltech.com/4.5/richtext-structure.html? That link explains
how to iterate over tables, frames, lists. There's also a toHtml() that
will give you the contents in html.

Girish



More information about the Qt-interest-old mailing list