Chengxing Zhang
Chengxing Zhang

Reputation: 93

QWebEngineView crashed after loading some Map App(https://ditu.amap.com/)

  1. 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)
<--- 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 --->
  1. On Linux, My PyQt5 app works fine, but on MacOS, it doesn't, pretty strange.
  2. In both platforms, I use Conda python. Packages are shown below.
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
  1. The code of WebEngine is shown below
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!

Upvotes: 1

Views: 56

Answers (1)

Chengxing Zhang
Chengxing Zhang

Reputation: 93

Finally I used PySide6, problem solved.

Upvotes: 0

Related Questions