eric6_browser.py

branch
QtWebEngine
changeset 4840
69ee7965ba27
parent 4831
bf53c06fa0fb
child 4869
d1b3addfbd07
--- a/eric6_browser.py	Fri Mar 11 19:44:05 2016 +0100
+++ b/eric6_browser.py	Fri Mar 11 19:49:18 2016 +0100
@@ -68,7 +68,20 @@
 sys.path.insert(2, os.path.join(os.path.dirname(__file__),
                                 "ThirdParty", "Pygments"))
 
-from PyQt5 import QtWebEngineWidgets    # __IGNORE_WARNING__
+try:
+    from PyQt5 import QtWebEngineWidgets    # __IGNORE_WARNING__
+except ImportError:
+    from PyQt5.QtCore import QTimer
+    from PyQt5.QtWidgets import QApplication
+    from E5Gui import E5MessageBox          # __IGNORE_WARNING__
+    app = QApplication([])
+    QTimer.singleShot(0, lambda: E5MessageBox.critical(
+        None,
+        "eric6 Web Browser",
+        "QtWebEngineWidgets is not installed but needed to execute the"
+        " web browser."))
+    app.exec_()
+    sys.exit(100)
 
 import Globals
 from Globals import AppInfo

eric ide

mercurial