Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.0 Alpha
-
None
Description
https://codereview.qt-project.org/#change,76134 added Keys.forwardTo in several controls.
Previously,
TextField {
Keys.onPressed: {
event.accepted = true;
}
}
would let all text/other inputs that TextInput accepted be handled by the TextInput inside of TextField, and any other events would be accepted by the TextField's Keys.onPressed handler.
With the change, the above code now causes all events to be accepted by the Keys.onPressed handler before the TextInput can handle them.
Here's an example of a useful case that no longer works:
Item { Keys.onPressed: { if (event.key == Qt.Key_Up || event.key == Qt.Key_Down) { // Do something with key up and key down, but not if the TextField // has active focus } } TextField { Keys.onPressed: { event.accepted = true; } } }