我的代码运行正常,但为什么我会收到警告消息:
QML Connections: Cannot assign to non-existent property "onValueChanged"
这是我如何链接到信号。
Connections {
target: myModel
onValueChanged: {
console.log("Valued changedRecieved in QML")
}
myModel 是一个 C++ 类,我使用 engine.rootContext()->setContextProperty("myModel", &model);
有没有办法消除这个警告?
最佳答案
在您的 Connections 范围内,只需设置 ignoreUnknownSignals: true
关于qt - 删除警告- QML 连接 : Cannot assign to non-existent property "onValueChanged",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30242277/