Important: Please read the Qt Code of Conduct -

WebView does not load url

  • I'm trying a very simple test application on Raspberri Pi 3, with a Buildroot environment and Qt 5.12.5.


    #include <QGuiApplication>
    #include <QQmlApplicationEngine>
    #include <QtWebView/QtWebView>
    int main(int argc, char *argv[])
        QGuiApplication app(argc, argv);
        QQmlApplicationEngine engine;
        const QUrl url(QStringLiteral("qrc:/main.qml"));
        QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url](QObject *obj, const QUrl &objUrl) {
            if (!obj && url == objUrl) QCoreApplication::exit(-1);
        }, Qt::QueuedConnection);
        return app.exec();


    import QtQuick 2.12
    import QtQuick.Window 2.12
    import QtWebView 1.1
    Window {
        visible: true
        width: 640
        height: 480
        WebView {
            url: ""
            onLoadProgressChanged: console.log(loadProgress)
            onLoadingChanged: console.log(loading)

    Here the output:

    # ./testWeb --no-sandbox
    QML debugging is enabled. Only use this in a safe environment.
    [0203/081353.795855:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale 
    [0203/081353.906904:WARNING:resource_bundle_qt.cpp(116)] locale_file_path.empty() for locale

    The screen shows the blank window only.
    I don't think the warnings about the locale are critical to load an URL (anyway I'm trying to understand how to fix them).

    Any idea?
    Thanks in advance

  • Well, it was simple enough:

        anchors.fill: parent

Log in to reply