QWebEngineView extremely slow
-
Hi,
I am building an application that does a lot of things. I wanted to have a built-in web browser, so I am creating it with QWebEngineView. The only problem is that it is so slow I can't even load a URL. The application itself is getting quite big with multiple threads, but this can't be the cause, right? If I create a separate super simple web browser it does work well.
Any help is appreciated.
-
@leon-missoul said in QWebEngineView extremely slow:
If I create a separate super simple web browser it does work well
Well, then it is something in your application. Without knowing more about it is hard to say what the problem is. How high is CPU/MEM usage of your application without QWebEngineView? Did you try to profile your app to see where it spends most time?
-
@jsulm Thanks for your response.
I made yet another simple one and it's the same. It's so slow that you can't even scroll.
Memory usage is about 400MB (my pc has 16GB) and CPU almost nothing. The new application is quite simple, so I can't figure out why this is happening.I did notice that in the 2 slow versions the browser was inside a qstackedwidget. In the faster one, it wasn't. Weird.
-
@leon-missoul said in QWebEngineView extremely slow:
@jsulm Thanks for your response.
I made yet another simple one and it's the same. It's so slow that you can't even scroll.
Memory usage is about 400MB (my pc has 16GB) and CPU almost nothing. The new application is quite simple, so I can't figure out why this is happening.I did notice that in the 2 slow versions the browser was inside a qstackedwidget. In the faster one, it wasn't. Weird.
I think I met the same question as yours. I construct my ui via PyDracula. And the QWebEngineView is very very very slow. So I just construct a ui with only a QWebEngineView, It's very fluent. It's so weird.
-
@BlackBird_BB I met the same problem QWebEngineView run slow in PyDracula. I found that the shadow effects use in the QWebEngineView. Just Change the QWebEngine grphic effect(not use the parent's shadow), and disable it. It performs work both PyOneDark and PyDracula
# DROP SHADOW in PyDracula self.shadow = QGraphicsDropShadowEffect(self) self.shadow.setBlurRadius(17) self.shadow.setXOffset(0) self.shadow.setYOffset(0) self.shadow.setColor(QColor(0, 0, 0, 150)) self.ui.bgApp.setGraphicsEffect(self.shadow) self.ui.webEngineView.setGraphicsEffect(self.shadow) self.ui.webEngineView.graphicsEffect().setEnabled(False)
hope it works for you.
-
Have you tried running it in Release mode? I have had some slow results in debug mode...Maybe try testing it in Release mode? Or deploy for your system and see if it's faster?
-
@desun_evan when I've experimented with
WebEngineView
release build works as intended to