Proper way to add WebChannel to QML WebEngineView
Solved
QML and Qt Quick
-
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 { id:wc registeredObjects: dummy } WebEngineView { id: wv objectName: "webView" anchors.left: parent.left anchors.right: parent.right anchors.top: testArea.bottom anchors.bottom: parent.bottom url: initialUrl webChannel: wc }
The runtime error here is:
Cannot register object "dummy" ( QQuickItem(0x113fdd0) ) without attached WebChannel.id property. Did you forget to set it?Can someone please tell me what I am doing wrong. Thanks
-David
-
Sorry for the hasty post.
A quick search on this forum told me what I needed to know. -
Hi,
Glad you found out ! Can you share your discovery so other people may find it more easily ?
4/4