May 2019
Intermediate to advanced
542 pages
13h 37m
English
Hyperlinks can also be added to Qt rich text using the <a> (anchor) tag, as follows:
<p>Download it today from <a href='http://www.example.com'>Example.com</a>!</p>
The exact behavior of hyperlinks varies according to the widget displaying the hyperlink and the settings of the widget.
The QTextBrowser by default will attempt to navigate to a hyperlink within the widget; keep in mind, however, that these links will only work if they are resource URLs or local file paths. QTextBrowser lacks a network stack and cannot be used to browse the internet.
It can, however, be configured to open URLs in an external browser; back in the Python script, add the following line of code to MainWindow.__init__():
main.setOpenExternalLinks(True) ...
Read now
Unlock full access