0

I try to get the QWebEngineView() up and running under Windows 10 (Parallels Desktop aka. Virtual Machine). With MacOSX this is no issue at all, but while testing it on windows everything stalls. I narrowed down the issue to the QWebEngineView.

No matter what how I want to load a web-page / local html site into the QWebEngineView, nothing works.

For example I try the example of https://zetcode.com/pyqt/qwebengineview/ which launches, and for some seconds you see a white screen within the window and then everything is gone (see start of this clip https://i.stack.imgur.com/A57s4.jpg). There is no error message in the console, there is nothing.

Is there anything I'm missing to install?

python -m pip list

Package           Version
----------------- --------
cachetools        4.2.2
future            0.18.2
pefile            2021.9.3
pip               21.2.4
py2exe            0.10.4.1
PyOpenGL          3.1.5
PyQt5             5.15.4
PyQt5-Qt5         5.15.2
PyQt5-sip         12.9.0
PyQtWebEngine     5.15.4
PyQtWebEngine-Qt5 5.15.2
PySide2           5.15.2
shiboken2         5.15.2
wheel             0.37.0

Probably related to this:

JaWeilBaum
  • 67
  • 1
  • 1
  • 4
  • 1
    If you load a url like `https://stackoverflow.com/` then it works? – eyllanesc Sep 17 '21 at 20:58
  • 1
    @JaWeilBaum just to be sure, you're using a plain QWebEngineView and `setUrl()`, right? It's possible it's a rendering issue with the virtualized video driver. – musicamante Sep 17 '21 at 21:56
  • @eyllanesc no, neither does that work - same behavior... – JaWeilBaum Sep 18 '21 at 07:46
  • @musicamante Yes a plain QWebEngineView and I user view.load(QUrl()) to load the page. The issue with the visualized video driver, is a fair point but not receiving any error message is strange. I even monitored with Procmon – JaWeilBaum Sep 18 '21 at 07:48

1 Answers1

-1

I have just tried the below code on Windows 10 (not a Virtual Machine though) and it seems to work fine.

import sys
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *


class Example(QWidget):

    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):

        vbox = QVBoxLayout(self)

        self.webEngineView = QWebEngineView()

        self.webEngineView.setUrl(QUrl("https://doc.qt.io/qt-5.15/reference-overview.html"))

        vbox.addWidget(self.webEngineView)

        self.setLayout(vbox)

        self.setGeometry(300, 300, 350, 250)
        self.setWindowTitle('QWebEngineView')

if __name__ == '__main__':
    app = QApplication(sys.argv)
    ex = Example()
    ex.show()
    sys.exit(app.exec_())

Hope this helps, if not then you may be looking at a bigger issue (probably musicmante is on the right track)