eric6/eric6_browser.py

changeset 7945
76daafe10009
parent 7923
91e843545d9a
child 7960
e8fc383322f7
equal deleted inserted replaced
7941:cf988a30ba47 7945:76daafe10009
64 "QtWebEngineWidgets is not installed but needed to execute the" 64 "QtWebEngineWidgets is not installed but needed to execute the"
65 " web browser.")) 65 " web browser."))
66 app.exec() 66 app.exec()
67 sys.exit(100) 67 sys.exit(100)
68 68
69 from PyQt5.QtWebEngineCore import QWebEngineUrlScheme
70
69 import Globals 71 import Globals
70 from Globals import AppInfo, qVersionTuple 72 from Globals import AppInfo
71 73
72 from E5Gui.E5Application import E5Application 74 from E5Gui.E5Application import E5Application
73 75
74 from Toolbox import Startup 76 from Toolbox import Startup
75 77
159 options) 161 options)
160 162
161 # set the library paths for plugins 163 # set the library paths for plugins
162 Startup.setLibraryPaths() 164 Startup.setLibraryPaths()
163 165
164 if qVersionTuple() >= (5, 12, 0): 166 scheme = QWebEngineUrlScheme(b"eric")
165 from PyQt5.QtWebEngineCore import QWebEngineUrlScheme 167 scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
166 scheme = QWebEngineUrlScheme(b"eric") 168 scheme.setFlags(QWebEngineUrlScheme.SecureScheme |
167 scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path) 169 QWebEngineUrlScheme.ContentSecurityPolicyIgnored)
168 scheme.setFlags(QWebEngineUrlScheme.SecureScheme | 170 QWebEngineUrlScheme.registerScheme(scheme)
169 QWebEngineUrlScheme.ContentSecurityPolicyIgnored) 171 if "--qthelp" in sys.argv:
170 QWebEngineUrlScheme.registerScheme(scheme)
171 if "--qthelp" in sys.argv and qVersionTuple() >= (5, 12, 0):
172 from PyQt5.QtWebEngineCore import QWebEngineUrlScheme
173 scheme = QWebEngineUrlScheme(b"qthelp") 172 scheme = QWebEngineUrlScheme(b"qthelp")
174 scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path) 173 scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
175 scheme.setFlags(QWebEngineUrlScheme.SecureScheme) 174 scheme.setFlags(QWebEngineUrlScheme.SecureScheme)
176 QWebEngineUrlScheme.registerScheme(scheme) 175 QWebEngineUrlScheme.registerScheme(scheme)
177 176

eric ide

mercurial