开发者

Display QDomDocument as HTML

开发者 https://www.devze.com 2023-04-13 05:52 出处:网络
EDIT Bounty goes to a decent FOSS-licensed function which will do the conversion. I have a QDomDocument which is HTML and I want to render it in a widget.

EDIT

Bounty goes to a decent FOSS-licensed function which will do the conversion.


I have a QDomDocument which is HTML and I want to render it in a widget.

There are loads of QtWebkit classes but they don't seem to use QDom* classes -- QWebPage uses QWebFrame which uses QWebElement.

Is it possible to render the QDomDocument except by saving it to an XML string and then parsi开发者_StackOverflow社区ng it back into a QWeb* class? That seems silly.


QtWebKit is 3-rd party element (Qt port of WebKit engine), and until Qt 4.7 doesn't have anything to do with QtXml module (possibly to keep them binary separate). So either you change your code to create QWebElement's or you will print it to XML and parse again or you will create your own function that traverses your QDomElement tree and create apropriate QWebElement tree.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号