这里有一个公共属性列表:http: //doc.qt.io/qt-5/qkeyevent.html
我尝试访问它们:
Keys.onPressed: {
console.log("matches: ", event.matches("="));
console.log("text: ", event.text());
console.log("native modifiers: ", event.nativeModifiers());
console.log("native scan code: ", event.nativeScanCode());
console.log("native virtual key: ", event.nativeVirtualKey());
}
我可以访问该matches
属性,但不能访问其他属性。
24.317 D: onPressed: matches: false
24.317 W: unknown: ...: TypeError: Property 'text' of object QQuickKeyEvent(0x10e6cad90) is not a function
为什么?