From frank at ohufx.com Sun Dec 10 06:06:05 2017 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Sun, 10 Dec 2017 18:06:05 +1300 Subject: [PySide] PySide > Pyside2: QWebVIew and QWebPage Message-ID: <7c45d60a-e3bd-ae53-9198-2661256b92bb@ohufx.com> 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 *vfx compositing | *workflow customisation and consulting * * ** Your gateway to over 1,000 free tools... right inside of Nuke -------------- next part -------------- An HTML attachment was scrubbed... URL: From vihorev at gmail.com Sun Dec 10 14:50:42 2017 From: vihorev at gmail.com (Alexey Vihorev) Date: Sun, 10 Dec 2017 15:50:42 +0200 Subject: [PySide] PySide > Pyside2: QWebVIew and QWebPage In-Reply-To: <7c45d60a-e3bd-ae53-9198-2661256b92bb@ohufx.com> References: <7c45d60a-e3bd-ae53-9198-2661256b92bb@ohufx.com> Message-ID: <5a2d3bb3.59412e0a.be313.0116@mx.google.com> Hi! I guess you’re looking for this: http://doc.qt.io/qt-5/qwebenginepage.html#acceptNavigationRequest От: Frank Rueter | OHUfx Отправлено: 10 декабря 2017 г. в 7:06 Кому: 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 -- vfx compositing | workflow customisation and consulting     Your gateway to over 1,000 free tools... right inside of Nuke -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Sun Dec 10 22:09:02 2017 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Mon, 11 Dec 2017 10:09:02 +1300 Subject: [PySide] PySide > Pyside2: QWebVIew and QWebPage In-Reply-To: <5a2d3bb3.59412e0a.be313.0116@mx.google.com> References: <7c45d60a-e3bd-ae53-9198-2661256b92bb@ohufx.com> <5a2d3bb3.59412e0a.be313.0116@mx.google.com> Message-ID: <2fcde230-d1bf-d325-4468-f162f2af6918@ohufx.com> 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 > *Отправлено: *10 декабря 2017 г. в 7:06 > *Кому: *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 > > > > > *vfx compositing **| **workflow > customisation and consulting * > > > > > > http://nukepedia.com/images/nuBridge/logo/nuBridge_logo.png > > > > > > Your gateway to over 1,000 free tools... right inside of Nuke > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Sun Dec 10 22:52:58 2017 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Mon, 11 Dec 2017 10:52:58 +1300 Subject: [PySide] Application.type doesn't exist in PySide2 anymore Message-ID: <2fea3f95-bdf5-1399-d713-75ff60e04e9f@ohufx.com> And another PySide2 migration question: I used to do this to check id an app is run in GUI or command line mode: if QtWidgets.QApplication.type() == QtWidgets.QApplication.Type.GuiClient:     ... However QtWidgets.QApplication.type() doesn't exist in PySdie2 anymore. What's the best way to achieve the same goal? Thanks, frank -- ohufxLogo 50x50 *vfx compositing | *workflow customisation and consulting * * ** Your gateway to over 1,000 free tools... right inside of Nuke -------------- next part -------------- An HTML attachment was scrubbed... URL: From vihorev at gmail.com Sun Dec 10 22:58:36 2017 From: vihorev at gmail.com (Alexey Vihorev) Date: Sun, 10 Dec 2017 23:58:36 +0200 Subject: [PySide] Application.type doesn't exist in PySide2 anymore In-Reply-To: <2fea3f95-bdf5-1399-d713-75ff60e04e9f@ohufx.com> References: <2fea3f95-bdf5-1399-d713-75ff60e04e9f@ohufx.com> Message-ID: <5a2dae0d.e4212e0a.9ca55.14cc@mx.google.com> http://doc.qt.io/qt-5/sourcebreaks.html • QCoreApplication::Type and QApplication::type() are removed. These Qt 3 legacy application types did not match the application types available in Qt 5. Use qobject_cast instead to dynamically find out the exact application type. От: Frank Rueter | OHUfx Отправлено: 10 декабря 2017 г. в 23:53 Кому: pyside at qt-project.org Тема: [PySide] Application.type doesn't exist in PySide2 anymore And another PySide2 migration question: I used to do this to check id an app is run in GUI or command line mode: if QtWidgets.QApplication.type() == QtWidgets.QApplication.Type.GuiClient:     ... However QtWidgets.QApplication.type() doesn't exist in PySdie2 anymore. What's the best way to achieve the same goal? Thanks, frank -- vfx compositing | workflow customisation and consulting     Your gateway to over 1,000 free tools... right inside of Nuke -------------- next part -------------- An HTML attachment was scrubbed... URL: From frank at ohufx.com Mon Dec 11 00:20:27 2017 From: frank at ohufx.com (Frank Rueter | OHUfx) Date: Mon, 11 Dec 2017 12:20:27 +1300 Subject: [PySide] Application.type doesn't exist in PySide2 anymore In-Reply-To: <5a2dae0d.e4212e0a.9ca55.14cc@mx.google.com> References: <2fea3f95-bdf5-1399-d713-75ff60e04e9f@ohufx.com> <5a2dae0d.e4212e0a.9ca55.14cc@mx.google.com> Message-ID: great, thank you, I will look into this... On 11/12/17 10:58 AM, Alexey Vihorev wrote: > > http://doc.qt.io/qt-5/sourcebreaks.html > > ·|QCoreApplication::Type| and |QApplication::type()| are removed. > These Qt 3 legacy application types did not match the application > types available in Qt 5. Use |qobject_cast| instead to dynamically > find out the exact application type. > > *От: *Frank Rueter | OHUfx > *Отправлено: *10 декабря 2017 г. в 23:53 > *Кому: *pyside at qt-project.org > *Тема: *[PySide] Application.type doesn't exist in PySide2 anymore > > And another PySide2 migration question: > I used to do this to check id an app is run in GUI or command line mode: > if QtWidgets.QApplication.type() == QtWidgets.QApplication.Type.GuiClient: >     ... > > However QtWidgets.QApplication.type() doesn't exist in PySdie2 anymore. > What's the best way to achieve the same goal? > > Thanks, > frank > > -- > > ohufxLogo 50x50 > > > > > *vfx compositing **| **workflow > customisation and consulting * > > > > > > http://nukepedia.com/images/nuBridge/logo/nuBridge_logo.png > > > > > > Your gateway to over 1,000 free tools... right inside of Nuke > > -------------- next part -------------- An HTML attachment was scrubbed... URL: