1

There is a list of public properties here: http://doc.qt.io/qt-5/qkeyevent.html

I try to access them:

            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());
            }

I can access the matches property, but not the others.

24.317 D: onPressed: matches:  false
24.317 W: unknown: ...: TypeError: Property 'text' of object QQuickKeyEvent(0x10e6cad90) is not a function

Why?

user1283776
  • 19,640
  • 49
  • 136
  • 276

1 Answers1

2

Because you are access a property as a function call.

Just use event.text instead.

sk2212
  • 1,688
  • 4
  • 23
  • 43