QTextBrowser or QWebView?

I need to display some HTML content (generated by the application), and I am wondering whether to use QTextBrowser or QWebView. Although they seem pretty similar, the document does not discuss the differences between them.

I think QWebView is a full-featured browser, but what about QTextBrowser? Does he also use webkit? Can I use some restrictions if I use it?

+4
source share
1 answer

QTextBrowser only supports a subset of HTML and CSS, for documenation see here . The advantage is that it is lightweight, QWebView uses a lot more code and resources.

Additional information . The answer is correct, but I have to fill it with additional information (OP). As a warning, read the link provided to get tags and styles that work. em sizes don't seem to work, so set all your sizes in pixels; HR style is extremely limited; bottom-border style is not available (which could be a good alternative to HR) ;, so do not make your design in Firefox and expect it to work in Qt. Most likely, this will not happen. Check ref when something is not working, when you except and configure when you go. In the end, it may be possible to do a lot of projects with QTextBrowser, but it's better to check how you go.

+8
source

Source: https://habr.com/ru/post/1384047/


All Articles