Have you seen <a href="http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/">http://labs.qt.nokia.com/2009/03/12/wysiwyg-html-editor/</a>? I'm not sure if the example there will help with your problems at all. Just a guess, though - for your item #1 - the blog references using javascript code from c++ to interact. You could easily write a javascript function (heck, use jQuery too, if you want) to convert the DOM (or a node tree) to an HTML string. And the blog post even references viewing html with syntax highlighting.<div>

<br></div><div>Anyway, just a heads-up to some prior work on the subject - you may have already seen it and know all about it. Just a thought anyway.</div><div><br></div><div>Cheers!</div><div>-Josiah<br><div><br><div class="gmail_quote">

On Tue, Aug 7, 2012 at 9:39 PM, 程梁 <span dir="ltr"><<a href="mailto:chengliang.soft@gmail.com" target="_blank">chengliang.soft@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi, there!<br><br>I'm trying to develop a WYSIWYG HTML editor based on QtWebkit, but nowadays<br>I found some problems:<br><br>1. The HTML source code generated by QWebFrame::toHtml() is rather complex,<br>for example, it will add a style in <body /> which is not necessary. Could I generate<br>



the HTML source code by myself? If I use QTextEdit, I could loop all text blocks and<br>try to create source code according to each block. But how could I do the same<br>with QWebFrame?<br><br>2. I want to format HTML generated by QWebFrame. I'm using QPlainTextEdit.<br>



I could add syntax highlight by QSyntaxHighlighter, but how could I add HTML formatter?<br>Maybe I could try QXMLFormatter, am I right? Or something else?<br><br>Thank you for any suggestion!<span class="HOEnZb"><font color="#888888"><br clear="all">

<br>-- <br>Cheng Liang<a href="http://about.me/devbean" target="_blank"></a><br>

Nanjing, China<br><a href="http://www.devbean.info" target="_blank">http://www.devbean.info</a><br>from: <a href="mailto:devbean@devbean.info" target="_blank">devbean@devbean.info</a><br>
</font></span><br>_______________________________________________<br>
Interest mailing list<br>
<a href="mailto:Interest@qt-project.org">Interest@qt-project.org</a><br>
<a href="http://lists.qt-project.org/mailman/listinfo/interest" target="_blank">http://lists.qt-project.org/mailman/listinfo/interest</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Josiah Bryan<br>765-215-0511<br><a href="mailto:josiahbryan@gmail.com" target="_blank">josiahbryan@gmail.com</a><br>
</div></div>