Important: Please read the Qt Code of Conduct -

Proper way to add WebChannel to QML WebEngineView

  • I do not see any examples on how to configure a WebChannel from QML. Here is what I have tried thus far:

     Item {
                id: dummy
            WebChannel {
                registeredObjects: dummy
            WebEngineView {
                id: wv
                objectName: "webView"
                anchors.left: parent.left
                anchors.right: parent.right
                anchors.bottom: parent.bottom
                url: initialUrl
                webChannel: wc

    The runtime error here is:
    Cannot register object "dummy" ( QQuickItem(0x113fdd0) ) without attached property. Did you forget to set it?

    Can someone please tell me what I am doing wrong. Thanks


  • Sorry for the hasty post.
    A quick search on this forum told me what I needed to know.

  • Lifetime Qt Champion


    Glad you found out ! Can you share your discovery so other people may find it more easily ?

  • This link got me a little further. But think there should be a complete example as part of Qt/Examples

Log in to reply