Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

WebView support on desktop



  • I'd like some clarification of the support of WebView on desktop platforms - specifically use of WebView in QML.

    I'm building Qt from source, and I'm currently using a static build although this isn't strictly necessary, and I've built Qt without QtWebEngine (i.e. -skip QtWebEngine).

    On macOS the WebView works well using this configuration (i.e. QtWebView::initiliaze() then import WebView in QML) without having built QtWebEngine.

    On Windows 10 the WebView doesn't work (although there are no errors or warnings that I can see, i.e. the app builds and runs but the WebView just shows up as blank).

    The documentation implies that to use WebView on desktop platforms requires the QtWebEngine module but that doesn't appear to be 100% correct (i.e. it works without it on macOS).

    Presumably for it to work on Windows I need to re-configure and build Qt with QtWebEngine enabled?

    Many thanks in advance!


  • Lifetime Qt Champion

    Hi,

    From memory, QtWebView will use the system's web view when there's one available. IIRC, that concerns iOS, Androïd and macOS. For other platforms, it will rely on QtWebEngine.

    Note that QtWebEngine cannot be built statically because of Chromium that powers it.



  • @SGaist thanks for the response. That's pretty much what I thought, but I was unsure why it seems to work fine on macOS since here it suggests it shouldn't:

    "On Windows, Linux, and macOS, Qt WebView depends on the Qt WebEngine module to render content."


  • Lifetime Qt Champion

    Looks like a document bug.

    The module code says otherwise.


  • Lifetime Qt Champion

    Fix in progress


Log in to reply