When setting an hyperlink to a QTextBrowser
, I would like that link not to be underlined. In previous versions of Qt (e.g. 2,3,4), there used to be a setLinkUnderline(bool)
method which probably did the job. How to do this with Qt5 ?
thanks
When setting an hyperlink to a QTextBrowser
, I would like that link not to be underlined. In previous versions of Qt (e.g. 2,3,4), there used to be a setLinkUnderline(bool)
method which probably did the job. How to do this with Qt5 ?
thanks
A possible solution is to eliminate the underline using css:
#include <QApplication>
#include <QTextBrowser>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QTextBrowser w;
w.document()->setDefaultStyleSheet("a{ text-decoration: none; }");
w.append("<a href=\"https://stackoverflow.com/\">Stack Overflow</a>");
w.show();
return a.exec();
}