PDA

View Full Version : QTextBrowser and img...



mirag
25th January 2010, 15:10
Hi,

I would like to use QTextBrowser to display html help in application.
In the reference I found that this widget provide basic html support with
navigation - exactly what I need. Unfortunately I was unable to make it work.
Using setSource(path..) doesn't work - resulting in empty TextBrowser and msg:
TextBrowser: No Document: path_to_doc

i tried also setHtml(contnet_of_html_file) but this method doesn't load
images (i don't want to use Qt resources mechanism - my component has
to be able to open any local html file)

I know that there are a lot of posts about this (or similar) problem. I've read
most of them (I gave up after reading ~30 topics) and i've not found a solution
that works ( or clear statement that it won't work at all).

I would be grateful for any hint :)

Best regards,

mirag

Lykurg
25th January 2010, 22:11
More than in the other post we can not say. So the best would be, you create a minimal compilable program, that illustrate your problem. Then we will have a look at your code and see on.

faldzip
26th January 2010, 08:06
for me this works:


#include <QtGui>
int main(int argc, char **argv)
{
QApplication a(argc, argv);
QTextBrowser tb;
tb.setSource(QUrl("file:///C:/Users/nemrod/Desktop/test.html"));
tb.show();
return a.exec();
}

So maybe you set the url not properly?