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

Josinei Silva josinei_listas at yahoo.com.br
Tue Oct 26 02:56:59 CEST 2010


Em Seg 25 Out 2010, às 13:58:25, você escreveu:
John,

I tried with QTextDocumentFragment, but it didn't work. QTextFragment should 
solve my problem.

Qt Documentation about it is too poor. But i think i can solve it now.

Thanks.a lot.

Josinei

> QTextFragment?
> 
> On Oct 25, 2010, at 6:22 AM, Josinei Silva wrote:
> > 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