- I made an app based on QWebEngineView(PyQt5) to load a web map(https://ditu.amap.com/), but QWebEngineView failed after 1 second(Blank screen with error shown below)
<code><--- Last few GCs --->[92732:0x7100000000] 614 ms: Scavenge 2.6 (4.3) -> 1.7 (4.3) MB, 0.0 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure[92732:0x7100000000] 615 ms: Scavenge 2.6 (4.3) -> 1.7 (4.3) MB, 0.0 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure[92732:0x7100000000] 624 ms: Scavenge 3.1 (4.7) -> 2.2 (5.0) MB, 0.1 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure<--- JS stacktrace ---></code><code><--- Last few GCs ---> [92732:0x7100000000] 614 ms: Scavenge 2.6 (4.3) -> 1.7 (4.3) MB, 0.0 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure [92732:0x7100000000] 615 ms: Scavenge 2.6 (4.3) -> 1.7 (4.3) MB, 0.0 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure [92732:0x7100000000] 624 ms: Scavenge 3.1 (4.7) -> 2.2 (5.0) MB, 0.1 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure <--- JS stacktrace ---> </code><--- Last few GCs ---> [92732:0x7100000000] 614 ms: Scavenge 2.6 (4.3) -> 1.7 (4.3) MB, 0.0 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure [92732:0x7100000000] 615 ms: Scavenge 2.6 (4.3) -> 1.7 (4.3) MB, 0.0 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure [92732:0x7100000000] 624 ms: Scavenge 3.1 (4.7) -> 2.2 (5.0) MB, 0.1 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure <--- JS stacktrace --->
- On Linux, My PyQt5 app works fine, but on MacOS, it doesn’t, pretty strange.
- In both platforms, I use Conda python. Packages are shown below.
<code>Python==3.8numpy==1.24.4opencv-python==3.4.17.61PyQt5==5.15.11PyQt5-Qt5==5.15.14PyQt5_sip==12.15.0PyQtWebEngine==5.15.7PyQtWebEngine-Qt5==5.15.14</code><code>Python==3.8 numpy==1.24.4 opencv-python==3.4.17.61 PyQt5==5.15.11 PyQt5-Qt5==5.15.14 PyQt5_sip==12.15.0 PyQtWebEngine==5.15.7 PyQtWebEngine-Qt5==5.15.14 </code>Python==3.8 numpy==1.24.4 opencv-python==3.4.17.61 PyQt5==5.15.11 PyQt5-Qt5==5.15.14 PyQt5_sip==12.15.0 PyQtWebEngine==5.15.7 PyQtWebEngine-Qt5==5.15.14
- The code of WebEngine is shown below
<code>from PyQt5.QtCore import QUrl, Qtfrom PyQt5.QtWebEngineWidgets import QWebEngineViewclass WebWidget(QWebEngineView):def __init__(self, parent=None):super(WebWidget, self).__init__(parent)self.setMouseTracking(True)url = 'https://ditu.amap.com/'self.load(QUrl(url))self.focusProxy().installEventFilter(self)</code><code>from PyQt5.QtCore import QUrl, Qt from PyQt5.QtWebEngineWidgets import QWebEngineView class WebWidget(QWebEngineView): def __init__(self, parent=None): super(WebWidget, self).__init__(parent) self.setMouseTracking(True) url = 'https://ditu.amap.com/' self.load(QUrl(url)) self.focusProxy().installEventFilter(self) </code>from PyQt5.QtCore import QUrl, Qt from PyQt5.QtWebEngineWidgets import QWebEngineView class WebWidget(QWebEngineView): def __init__(self, parent=None): super(WebWidget, self).__init__(parent) self.setMouseTracking(True) url = 'https://ditu.amap.com/' self.load(QUrl(url)) self.focusProxy().installEventFilter(self)
Please help!