[PySide] PySide > Pyside2: QWebVIew and QWebPage

Frank Rueter | OHUfx frank at ohufx.com
Sun Dec 10 06:06:05 CET 2017


Hi all,

I have this bit of code in PySide that I need to translate to work in 
PySide2.
The goal is to embed a functional webpage in my PySide2 application but 
delegate all clicked links to the system browser (instead of viewing 
them in the widget)

    from PySide.QtWebKit import QWebView, QWebPage

    class HtmlView(QWebView):
         def __init__(self, parent=None):
             super(HtmlView, self).__init__(parent)
    self.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
             self.linkClicked.connect(self.openWebsite)


I tried this for PySide2:

    from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEnginePage 

    class HtmlView(QWebEngineView):
         def __init__(self, parent=None):
             super(HtmlView, self).__init__(parent)
    self.page().setLinkDelegationPolicy(QWebEnginePage.DelegateAllLinks)
             self.linkClicked.connect(self.openWebsite)

However, /QWebEngineView.linkClicked/ does not exist and neither does 
/QWebEngineView/.setLinkDelegationPolicy or
/QWebEnginePage.DelegateAllLinks.

/I'm aware that PySide2 is still alpha but I have to get this working 
somehow regardless/.
/Any help would be greatly appreciated./
/
Cheers,
frank

-- 

ohufxLogo 50x50 <http://www.ohufx.com> 	
	*vfx compositing <http://ohufx.com/compositing.html> | *workflow 
customisation and consulting <http://ohufx.com/customising.html>* *
		*<http://ohufx.com/compositing.html>*
<http://www.nukepedia.com/nubridge> 	
	

Your gateway to over 1,000 free tools... right inside of Nuke 
<http://www.nukepedia.com/nubridge>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20171210/5e7818da/attachment.html>


More information about the PySide mailing list