[PySide] PySide > Pyside2: QWebVIew and QWebPage

Frank Rueter | OHUfx frank at ohufx.com
Sun Dec 10 22:09:02 CET 2017


Yes, found it. Thank you!

On 12/11/2017 02:50 AM, Alexey Vihorev wrote:
>
> Hi!
>
> I guess you’re looking for this:
>
> http://doc.qt.io/qt-5/qwebenginepage.html#acceptNavigationRequest
>
> *От: *Frank Rueter | OHUfx <mailto:frank at ohufx.com>
> *Отправлено: *10 декабря 2017 г. в 7:06
> *Кому: *pyside at qt-project.org <mailto:pyside at qt-project.org>
> *Тема: *[PySide] PySide > Pyside2: QWebVIew and QWebPage
>
> 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://nukepedia.com/images/nuBridge/logo/nuBridge_logo.png 
> <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/20171211/436047e1/attachment.html>


More information about the PySide mailing list