{"id":4715,"library":"pyqt6-webengine-qt6","title":"PyQt6-WebEngine-Qt6","description":"PyQt6-WebEngine-Qt6 is a supplementary package containing the essential subset of a Qt installation specifically required by PyQt6-WebEngine. It typically installs automatically as a dependency when a user installs PyQt6-WebEngine, which provides Python bindings for the Qt WebEngine framework. This framework enables embedding web content in applications using a Chromium-based engine. The current version is 6.11.0, and its release cadence generally aligns with updates to PyQt6 and the underlying Qt WebEngine.","status":"active","version":"6.11.0","language":"en","source_language":"en","source_url":"https://www.riverbankcomputing.com/software/pyqtwebengine/","tags":["GUI","Qt","WebEngine","browser","webview","PyQt6","web-rendering"],"install":[{"cmd":"pip install PyQt6-WebEngine","lang":"bash","label":"Install PyQt6-WebEngine (includes PyQt6-WebEngine-Qt6)"}],"dependencies":[{"reason":"PyQt6-WebEngine is built on top of PyQt6, and this package provides the Qt runtime components for it.","package":"PyQt6"}],"imports":[{"note":"In PyQt6, WebEngine components are in a dedicated submodule, not directly under QtWidgets or the main PyQt6 namespace.","wrong":"from PyQt6.QtWidgets import QWebEngineView","symbol":"QWebEngineView","correct":"from PyQt6.QtWebEngineWidgets import QWebEngineView"},{"note":"Many core WebEngine classes, including QWebEnginePage, moved from QtWebEngineWidgets to QtWebEngineCore in Qt6.","wrong":"from PyQt6.QtWebEngineWidgets import QWebEnginePage","symbol":"QWebEnginePage","correct":"from PyQt6.QtWebEngineCore import QWebEnginePage"},{"symbol":"QUrl","correct":"from PyQt6.QtCore import QUrl"}],"quickstart":{"code":"import sys\nfrom PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout\nfrom PyQt6.QtWebEngineWidgets import QWebEngineView\nfrom PyQt6.QtCore import QUrl\n\n\nclass SimpleBrowser(QWidget):\n    def __init__(self):\n        super().__init__()\n        self.setWindowTitle('PyQt6 WebEngine Browser')\n        self.setGeometry(100, 100, 1024, 768)\n\n        layout = QVBoxLayout(self)\n        self.webview = QWebEngineView()\n        layout.addWidget(self.webview)\n\n        # Load a URL (e.g., Google or your own site)\n        self.webview.setUrl(QUrl('https://www.google.com'))\n\n        self.setLayout(layout)\n\n\nif __name__ == '__main__':\n    app = QApplication(sys.argv)\n    browser = SimpleBrowser()\n    browser.show()\n    sys.exit(app.exec())","lang":"python","description":"This quickstart demonstrates how to embed a basic web browser using `QWebEngineView` to display a URL. It initializes a `QApplication`, creates a `QWidget` to host the `QWebEngineView`, and sets a target URL. The `sys.exit(app.exec())` line starts the event loop, displaying the window."},"warnings":[{"fix":"Update import statements: `from PyQt5.QtWebEngineWidgets import X` becomes `from PyQt6.QtWebEngineWidgets import X`, and `QWebEnginePage` (and similar core classes) should be imported from `PyQt6.QtWebEngineCore`.","message":"When migrating from PyQt5, the import structure for WebEngine classes has changed. Classes are now strictly separated into `PyQt6.QtWebEngineWidgets` (for widgets like `QWebEngineView`) and `PyQt6.QtWebEngineCore` (for core functionalities like `QWebEnginePage`, `QWebEngineProfile`). Direct imports from the main `PyQt6` namespace or `QtWidgets` for WebEngine components will fail.","severity":"breaking","affected_versions":"All PyQt6 versions when migrating from PyQt5."},{"fix":"Consult the official Qt 6 WebEngine documentation and PyQt6 examples for updated method calls and class locations. Refactor code to use new signals/slots and class names.","message":"Several Qt WebEngine API methods have moved or changed signatures in Qt 6. For example, `QWebEnginePage::print()` no longer takes a callback and has moved to `QWebEngineView::print()`, signalling completion with `QWebEngineView::printFinished()`. Similarly, `QWebEngineDownloadItem` has been renamed to `QWebEngineDownloadRequest` and moved to `QtWebEngineCore`.","severity":"breaking","affected_versions":"All PyQt6 versions when migrating from PyQt5/Qt5 WebEngine."},{"fix":"Always use `app.exec()` to start the application's event loop.","message":"The method to start the application's event loop has changed from `app.exec_()` (used in older Python 2 compatible PyQt5 code) to `app.exec()` in PyQt6. While `app.exec()` is also available and preferred in modern PyQt5, using `app.exec_()` will raise an error in PyQt6.","severity":"gotcha","affected_versions":"All PyQt6 versions."},{"fix":"Create a custom `QWebEngineView` subclass and override `createWindow()` to instantiate and return a new `QWebEngineView` (or a custom `WebPopupWindow`) for each new window request.","message":"QWebEngineView does not automatically handle pop-up windows (e.g., those created by JavaScript `window.open()`). To support these, you must subclass `QWebEngineView` and reimplement its `createWindow()` method.","severity":"gotcha","affected_versions":"All PyQt6-WebEngine versions."},{"fix":"If encountering severe performance issues, try downgrading the `PyQt6-WebEngine-Qt6` package (or `PyQt6-WebEngine`) to an earlier minor version if possible. Report issues to the PyQt or Qt bug trackers, providing detailed system and GPU information. Disabling hardware acceleration might be a workaround in some cases.","message":"Users have reported performance issues such as laggy scrolling and jerky videos with specific Qt WebEngine versions (e.g., Qt 6.7.0-1) on certain platforms, particularly Linux/X11, and sometimes involving specific GPU drivers. This may manifest as 'glitching' or 'Z-fighting'.","severity":"gotcha","affected_versions":"Specific versions of Qt WebEngine (e.g., 6.7.x) and associated PyQt6-WebEngine releases."}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}