qtwebsockets

Qt WebView and WebChannel over WebSockets in QML

匆匆过客 提交于 2019-12-08 07:14:55
问题 I want to access QtObject from HTML-page running in WebView - invoke methods, read/write properties, etc. As far as I understood, I need to establish WebSockets connection between QML and HTML sides, and then use it as a transport for WebChannel. Don't confuse WebView with WebEngineView - I know how to do it with WebEngineView, but I need to do it with WebView. So, here's what I have. QML side QtObject { id: someObject WebChannel.id: "backend" property string someProperty: “property value" }

Qt WebView and WebChannel over WebSockets in QML

て烟熏妆下的殇ゞ 提交于 2019-12-06 15:57:06
I want to access QtObject from HTML-page running in WebView - invoke methods, read/write properties, etc. As far as I understood, I need to establish WebSockets connection between QML and HTML sides, and then use it as a transport for WebChannel . Don't confuse WebView with WebEngineView - I know how to do it with WebEngineView, but I need to do it with WebView. So, here's what I have. QML side QtObject { id: someObject WebChannel.id: "backend" property string someProperty: “property value" } WebSocketServer { listen: true port: 55222 onClientConnected: { console.log(webSocket.status); /