Solved Intercept QML keys on C++ side.
-
@egor.utsov said in Intercept QML keys on C++ side.:
if (event->type() == QEvent::Type::KeyPress || event->type() == QEvent::KeyRelease)
Can you just print the event type in eventFilter function ? Right now it is condition based. When you press the keyboard let us see what type events are coming. This may give us hint. If not we will do something else.
-
@dheerendra i am also tried to enable QT_LOGGING_RULES="qt.qpa.input=true", but key events still not printed, however i see beginning of qpa logs
-
while we debug this issue, another option what you can try is Keys.forwardTo option in qml. We can make all the key events forward to one common object. This common object can handle your blackout logic.
what is happening in eventfilter function ? Is it printing the type as key event or not ?
-
@dheerendra Hi. I reboot the unit and now key events appeared in filter. I don't know whats changed, but it works now. Thank you for help and sorry for bothering