Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. WebEngineScript sourceUrl: Can't open user script

WebEngineScript sourceUrl: Can't open user script

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 490 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    elaf
    wrote on last edited by
    #1

    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:

    <RCC>
        <qresource>
            <file>main.qml</file>
            <file>qwebchannel.js</file>
        </qresource>
    </RCC>
    

    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

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved