[Qt-interest] How to user QTextBlockUserData?

程梁 chengliang.soft at gmail.com
Mon Dec 27 16:35:09 CET 2010


Hi, there! I wounder how can I use class QTextBlockUserData?

I'm trying to develop an HTML editor using QTextEdit as a visual
editor. The HTML text
generated by QTextEdit is related to Qt itself, so I have to generate
simpler HTML text
myself instead of using QTextEdit::toHtml(). I want to store css or
other data in QTextBlockUserData
which can be related to QTextBlock. But I've no idea how to use it.
QTextCursor::insertBlock();
returns void; QTextCursor::block() returns QTextCursor's copy, not a
reference or a pointer.
Although there is the function QTextBlock::setUserData(), but how can
I add the data?
Or some idea about developing an HTML editor?

Thank you!

-- 
Cheng Liang
from: chengliang.soft at gmail.com



More information about the Qt-interest-old mailing list