QWebEngineView window won't show
-
I wrote a simple test program to load a URL in a QWebEngineView. The program works on Mac; the browser pops up and I can see the webpage. But on Windows 7, the browser window never appears after I call show():
import sys from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEngineView from PyQt5.QtCore import QUrl class Browser(QWebEngineView): def __init__(self): super().__init__() self.loadProgress.connect(print) self.load(QUrl('https://google.com')) self.loadFinished.connect(self.pageReady) def pageReady(self, success): if success: self.resize(640, 480) self.show() else: print('page failed to load') if __name__ == '__main__': app = QApplication(sys.argv) browser = Browser() app.exec_()
Using self.loadProgress.connect(print), I verified that the page does reach 100% progress -- but the browser window never appears. My firewall is disabled, so there shouldn't be a connection problem.
I'm on Windows 7, using PyQt5 (5.12.1), PyQt5-sip (4.19.15), and PyQtWebEngine (5.12.1). I installed them by running:
pip install pyqt5
pip install PyQtWebEngine
I did not install Qt separately.
I also tried PyQt5 5.12 without success. -
I wrote a simple test program to load a URL in a QWebEngineView. The program works on Mac; the browser pops up and I can see the webpage. But on Windows 7, the browser window never appears after I call show():
import sys from PyQt5.QtWidgets import QApplication from PyQt5.QtWebEngineWidgets import QWebEngineView from PyQt5.QtCore import QUrl class Browser(QWebEngineView): def __init__(self): super().__init__() self.loadProgress.connect(print) self.load(QUrl('https://google.com')) self.loadFinished.connect(self.pageReady) def pageReady(self, success): if success: self.resize(640, 480) self.show() else: print('page failed to load') if __name__ == '__main__': app = QApplication(sys.argv) browser = Browser() app.exec_()
Using self.loadProgress.connect(print), I verified that the page does reach 100% progress -- but the browser window never appears. My firewall is disabled, so there shouldn't be a connection problem.
I'm on Windows 7, using PyQt5 (5.12.1), PyQt5-sip (4.19.15), and PyQtWebEngine (5.12.1). I installed them by running:
pip install pyqt5
pip install PyQtWebEngine
I did not install Qt separately.
I also tried PyQt5 5.12 without success.@freethewall Did you verify that pageReady is called?
-
Yes, it is called, with success=True.