【发布时间】:2015-10-08 21:38:10
【问题描述】:
当我尝试使用 QWebChannel 将基于 QObject 的子类的实例发送到 html 客户端时,出现以下错误:
JSON 消息对象缺少 id 属性:{ “类型”:3 }
server-client连接本身成功,只是对象无法发送。大概有人知道答案吗?
在运行 Qt 服务器后使用 Qt WebChannel Standalone Example 重现并在 Web 浏览器中加载 file:///C:/Qt/5.5/Examples/Qt-5.5/webchannel/build-standalone-Desktop_Qt_5_5_0_MinGW_32bit-Debug/index.html?webChannelBaseUrl=ws://localhost:12345。
【问题讨论】: