Reputation: 30895
I'm using QTextBrowser, and setting it with link like this:
QString url =
"http://developer.qt.nokia.com/doc/qt-4.8/qtextbrowser.html#source-prop";
textBrowser->setOpenExternalLinks(true);
textBrowser->setHTML(url);
or with:
textBrowser->setSource(QUrl(url));
or even:
QString u = "<a href=\""+url+"\">"+url+"</a>";
textBrowser->setHTML(u);
but nothing happens. If I add the setSource I don't even see the fonts.
Upvotes: 3
Views: 1964
Reputation: 17234
You have used
textBrowser->setHTML(url);
but it isn't actually a valid HTML to create a link. You need to use a href
. See the supported html subset here.
https://doc.qt.io/archives/qt-4.8/richtext-html-subset.html
Upvotes: 1