WebBrowser.Network.NetworkManager: added some code to make the web browser compatible to Qt 5.12. maintenance

Fri, 08 Feb 2019 19:16:17 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 08 Feb 2019 19:16:17 +0100
branch
maintenance
changeset 6748
f5643095498a
parent 6747
09ad978cb776
child 6749
f5ce328edcf5

WebBrowser.Network.NetworkManager: added some code to make the web browser compatible to Qt 5.12.
(grafted from 89db2d786530c78dfc6719e069ddde30aa7630b3)

WebBrowser/Network/NetworkManager.py file | annotate | diff | comparison | revisions
--- a/WebBrowser/Network/NetworkManager.py	Fri Feb 08 17:55:07 2019 +0100
+++ b/WebBrowser/Network/NetworkManager.py	Fri Feb 08 19:16:17 2019 +0100
@@ -29,6 +29,7 @@
 from .NetworkUrlInterceptor import NetworkUrlInterceptor
 from ..Tools.WebBrowserTools import readAllFileContents, pixmapToDataUrl
 
+from Globals import qVersionTuple
 from Utilities.AutoSaver import AutoSaver
 import Preferences
 
@@ -78,12 +79,24 @@
         self.authenticationRequired.connect(
             lambda reply, auth: self.authentication(reply.url(), auth))
         
+        if qVersionTuple() >= (5, 12, 0):
+            from PyQt5.QtWebEngineCore import QWebEngineUrlScheme
+            scheme = QWebEngineUrlScheme(b"eric")
+            scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
+            scheme.setFlags(QWebEngineUrlScheme.SecureScheme)
+            QWebEngineUrlScheme.registerScheme(scheme)
         from .EricSchemeHandler import EricSchemeHandler
         self.__ericSchemeHandler = EricSchemeHandler()
         WebBrowserWindow.webProfile().installUrlSchemeHandler(
             QByteArray(b"eric"), self.__ericSchemeHandler)
         
         if engine:
+            if qVersionTuple() >= (5, 12, 0):
+                from PyQt5.QtWebEngineCore import QWebEngineUrlScheme
+                scheme = QWebEngineUrlScheme(b"qthelp")
+                scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
+                scheme.setFlags(QWebEngineUrlScheme.SecureScheme)
+                QWebEngineUrlScheme.registerScheme(scheme)
             from .QtHelpSchemeHandler import QtHelpSchemeHandler
             self.__qtHelpSchemeHandler = QtHelpSchemeHandler(engine)
             WebBrowserWindow.webProfile().installUrlSchemeHandler(

eric ide

mercurial