I make a widget to display a list of links from the rss feed. If you use WebView, then the links are normally displayed, but only open in the same WebView. And I want them to open through QDesktopServices.openUrl (), i.e. through a standard system browser. How can you display a list of links, so that on click each opens in a new window of a standard browser?
1 answer
Found a solution - use the same WebView, only change the Link Delegation Policy
webview.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) And hang the handler on the signal:
def linkClicked(url): webbrowser.open(str(url.toString())) self.webview.connect(self.webview.page(), SIGNAL("linkClicked (const QUrl&)"), linkClicked) |