[Qt-interest] How to change current line format in QTextEdit?

程梁 chengliang.soft at gmail.com
Fri Mar 25 00:54:49 CET 2011


Thank you! I'll try this.

What I reaaly need is when users click a button, even if they don't selected
any text, the current line's format will be changed. Just like Windows Live
Writer 2011 adds heading tags.

Mutilple-cursor could solve my problem. But why setBlockCharFormat and these
functions cannot apply? What does it mean "If the cursor has no selection,
current block format will be changed." in the document?


2011/3/24 Denis Mingulov <denis at mingulov.com>

> Hi,
>
> On Thu, Mar 24, 2011 at 3:11 PM, 程梁 <chengliang.soft at gmail.com> wrote:
> > format will be changed. But in my application, the current block in which
> > cursor is couldn't be changed. May I missed something? Then how could I
> > change current block format which has no selection?
> What's the problem? Use another cursor and select what is really needed for
> you.
>
> http://doc.qt.nokia.com/latest/richtext-cursor.html#multiple-cursors
> "Multiple cursors can be used to simultaneously edit the same
> document, although only one will be visible to the user in a QTextEdit
> widget. The QTextDocument ensures that each cursor writes text
> correctly and does not interfere with any of the others."
>
> --
> Best Regards,
> Denis Mingulov
>



-- 
Cheng Liang
from: chengliang.soft at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110325/adfcbc4f/attachment.html 


More information about the Qt-interest-old mailing list