Implemented four workarounds to suppress use of QtWebEngine on non-Linux systems because of issues in Qt 6.2.0 rc0. eric7

Sun, 19 Sep 2021 16:26:29 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 19 Sep 2021 16:26:29 +0200
branch
eric7
changeset 8617
3ea0b67205b6
parent 8616
651cc4e319fb
child 8618
356a2f1b04b0

Implemented four workarounds to suppress use of QtWebEngine on non-Linux systems because of issues in Qt 6.2.0 rc0.

eric7/UI/CodeDocumentationViewer.py file | annotate | diff | comparison | revisions
eric7/UI/Previewers/PreviewerHTML.py file | annotate | diff | comparison | revisions
eric7/eric7.py file | annotate | diff | comparison | revisions
eric7/eric7_browser.py file | annotate | diff | comparison | revisions
--- a/eric7/UI/CodeDocumentationViewer.py	Sun Sep 19 16:13:41 2021 +0200
+++ b/eric7/UI/CodeDocumentationViewer.py	Sun Sep 19 16:26:29 2021 +0200
@@ -81,6 +81,12 @@
         self.__verticalLayout.setContentsMargins(0, 0, 0, 0)
         
         try:
+            # TODO: remove this workaround once rc0 issue is fixed
+            # Workaround for a bug in Qt 6.2.0 rc0 on non-Linux
+            import sys
+            if not sys.platform.startswith("linux"):
+                raise ImportError
+            
             from PyQt6.QtWebEngineCore import QWebEngineSettings
             from PyQt6.QtWebEngineWidgets import QWebEngineView
             self.__contents = QWebEngineView(self)
--- a/eric7/UI/Previewers/PreviewerHTML.py	Sun Sep 19 16:13:41 2021 +0200
+++ b/eric7/UI/Previewers/PreviewerHTML.py	Sun Sep 19 16:26:29 2021 +0200
@@ -51,6 +51,11 @@
         self.__previewAvailable = True
         
         try:
+            # TODO: remove this workaround once rc0 issue is fixed
+            # Workaround for a bug in Qt 6.2.0 rc0 on non-Linux
+            if not sys.platform.startswith("linux"):
+                raise ImportError
+            
             from PyQt6.QtWebEngineWidgets import QWebEngineView
             self.previewView = QWebEngineView(self)
             self.previewView.page().linkHovered.connect(self.__showLink)
--- a/eric7/eric7.py	Sun Sep 19 16:13:41 2021 +0200
+++ b/eric7/eric7.py	Sun Sep 19 16:26:29 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__
+# TODO: remove this workaround once rc0 issue is fixed
+# Workaround for a bug in Qt 6.2.0 rc0 on non-Linux
+if sys.platform.startswith("linux"):
+    with contextlib.suppress(ImportError):
+        from PyQt6 import QtWebEngineWidgets
+        # __IGNORE_WARNING__ __IGNORE_EXCEPTION__
 
 # some global variables needed to start the application
 args = None
--- a/eric7/eric7_browser.py	Sun Sep 19 16:13:41 2021 +0200
+++ b/eric7/eric7_browser.py	Sun Sep 19 16:26:29 2021 +0200
@@ -36,6 +36,11 @@
         sys.argv.remove(arg)
 
 try:
+    # TODO: remove this workaround once rc0 issue is fixed
+    # Workaround for a bug in Qt 6.2.0 rc0 on non-Linux
+    if not sys.platform.startswith("linux"):
+        raise ImportError
+    
     from PyQt6 import QtWebEngineWidgets    # __IGNORE_WARNING__
 except ImportError:
     if "--quiet" not in sys.argv:

eric ide

mercurial