Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying (rendering) HTML from a string in QT

I have html in a QString, what widget can I use to display it? (QWebView is not necessary as I dont access Internet)

like image 944
Regof Avatar asked Apr 25 '10 19:04

Regof


2 Answers

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.

like image 50
Georg Fritzsche Avatar answered Sep 22 '22 05:09

Georg Fritzsche


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.

like image 25
swanson Avatar answered Sep 23 '22 05:09

swanson