[Qt-interest] Find block with differents formats inside QTextEdit

Josinei Silva josinei_listas at yahoo.com.br
Mon Oct 25 15:22:36 CEST 2010


Em Dom 24 Out 2010, às 02:19:11, Brad Hards escreveu:
> On Sunday, October 24, 2010 03:00:39 pm Josinei Silva wrote:
> > How i can get block by text format?
> 
> This is a bit difficult to answer without knowing what you've actually
>  tried (and what went wrong) but I think you probably just want to iterate
>  over the QTextEdit::document() using a QTextCursor. The documentation for
>  QTextCursor (http://doc.qt.nokia.com/latest/qtextcursor.html) explains
>  text blocks and text format much better than I could.
> 
> HTH
> 
> Brad

I tried to get block from QTextCursor with QTextBlock. But it splits text by 
paragraphs and not by text format.

A text wth just one paragraph returns only one QTextBlock even if there's 
parts of these paragraph with different formats ( bold, italic, differents 
font sizes ).

I need to split the text by format and not by paragraph.

Thanks

Josinei





More information about the Qt-interest-old mailing list