开发者

Displaying (rendering) HTML from a string in QT

开发者 https://www.devze.com 2022-12-28 16:04 出处:网络
I have html in a QString, wh开发者_StackOverflow社区at widget can I use to display it? (QWebView is not necessary as I dont access Internet)QWebViews setHtml():

I have html in a QString, wh开发者_StackOverflow社区at widget can I use to display it? (QWebView is not necessary as I dont access Internet)


QWebViews setHtml():

The QWebView class provides a widget that is used to view and edit web documents.

In Qt QWebView is the widget that renders pages for you - if you don't need the networking features it provides, simply don't use them.


Depending on what HTML tags you are using, you might be able to get away with a QTextEdit. It has support for most of HTML, including tables and images. Take a look at the docs and see if it fits your particular needs.

If you need something more advanced, then you will have to use the widgets in QtWebKit.

0

精彩评论

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

关注公众号