Due to a recent update, a small change is necessary to complete the MiniBrowser 
tutorial . QWebEngineView is no longer available as a separate widget. Instead, 
one positions a generic Widget in the MainWindow in Designer, then "promotes" 
it to a WebEngineView. 

Eric's installation process includes PyQt6-WebEngine and PyQt6-WebEngine-Qt6, 
so those should already be present. (You could confirm using eric's PyPl 
interface.)

In Designer, add a generic Widget (from the Containers section) to your form 
and give it a name, vwWebEngine, say. Right click on it, then select "Promote 
to". In the pop-up enter:
    Promoted class name = QWebEngineView 
    header file = PyQt6.QtWebEngineWidgets
then click Add, then Promote.

As noted in the tutorial, the WebEngine wants the website URL in a QUrl object, 
so add that to the PyQt6.Core import line in mainwindow.py:
from PyQt6.QtCore import pyqtSlot, QUrl

Then lines like these should load the website:
        txtAddr = self.txtUrl.text()
        self.vwWebEngine.setUrl(QUrl(txtAddr))

Robert


Reply via email to