Important: Please read the Qt Code of Conduct -

WebEngineScript sourceUrl: Can't open user script

  • I have tried to insert the qwebchannel.js script as WebEngineScript within a WebEngineView:

    WebEngineView {
        id: webbrowser02
        WebEngineScript {
            injectionPoint: WebEngineScript.DocumentCreation
            id: qwebchannel
            sourceUrl: "qrc:///qwebchannel.js"
            worldId: WebEngineScript.MainWorld
        userScripts: [qwebchannel]

    The script file qwebchannel.js is defined within the resources:


    Then, as I try to start, I've got the message:

    QFSFileEngine::open: No file name specified
    Can't open user script  QUrl("qrc:///qwebchannel.js")

    What' going wrong? I'm using Qt 5.5 with QtWebView 1.1

Log in to reply