November 22, 2010

eirikm eirikm
Lab Rat
14 posts

How good is the HTML and CSS support in QTextBrowser

 

I have used QTextBrowser as a help viewer in my application, as descriped in an example in Qt Quarterly. It mostly works, but I have a few problems with styling. Margins and padding doesn’t seem to work.

I couldn’t find any information about what is supported and what not. Does it exist, or is QTextBrowser so limited that something else should be used? WebKit seems like an alternative, but might be an overkill.

2 replies

November 22, 2010

Volker Volker
Robot Herder
5428 posts

QTextBrowser [doc.qt.nokia.com] is basically a read only version of QTextEdit [doc.qt.nokia.com] with some navigation functionality added. Both are not full-featured HTML browsers, as the internally rely on QTextDocument [doc.qt.nokia.com]. If it does not work properly for you, go with WebKit. I don’t see why this would be an overkill – it’s just adding “webkit” to the QT variable in your .pro file and some 5 lines of additional code. It’s not worth fiddling around the limitations of QTextBrowser.

November 23, 2010

blex blex
Lab Rat
191 posts
Volker wrote:
I don’t see why this would be an overkill – it’s just adding “webkit” to the QT variable in your .pro file and some 5 lines of additional code

No overkill except application size. Large library is added to the dependencies, it is also memory-consuming. But for the desktop it shouldn’t be a problem

 Signature 

————————————

Oleksiy Balabay

 
  ‹‹ Reading double values with sscanf in QT      Ubuntu 10.10 update loses QtMultimedia ››

You must log in to post a reply. Not a member yet? Register here!