eric7/eric7.py

branch
eric7
changeset 8693
d51660d6f1b9
parent 8673
2908e152eb2b
child 8699
8438a5a0437f
--- a/eric7/eric7.py	Sat Oct 16 20:37:32 2021 +0200
+++ b/eric7/eric7.py	Sat Oct 16 20:38:23 2021 +0200
@@ -42,9 +42,12 @@
         " it is installed and accessible.")
     sys.exit(100)
 
-with contextlib.suppress(ImportError):
-    from PyQt6 import QtWebEngineWidgets
-    # __IGNORE_WARNING__ __IGNORE_EXCEPTION__
+try:
+    from PyQt6 import QtWebEngineWidgets    # __IGNORE_WARNING__
+    from PyQt6.QtWebEngineCore import QWebEngineUrlScheme
+    WEBENGINE_AVAILABLE = True
+except ImportError:
+    WEBENGINE_AVAILABLE = False
 
 # some global variables needed to start the application
 args = None
@@ -292,6 +295,12 @@
     # set the library paths for plugins
     Startup.setLibraryPaths()
 
+    if WEBENGINE_AVAILABLE:
+        scheme = QWebEngineUrlScheme(b"qthelp")
+        scheme.setSyntax(QWebEngineUrlScheme.Syntax.Path)
+        scheme.setFlags(QWebEngineUrlScheme.Flag.SecureScheme)
+        QWebEngineUrlScheme.registerScheme(scheme)
+    
     app = EricApplication(sys.argv)
     ddindex = Startup.handleArgs(sys.argv, appinfo)
     

eric ide

mercurial