7877 Unexpected Behavior when pressing Enter on Input Field

This commit is contained in:
beholder 2017-09-26 01:07:47 +03:00
parent 191066a111
commit 5502a639e2

View file

@ -116,6 +116,13 @@ Item {
wrapMode: Text.WordWrap
readOnly: false // we need to leave this property read-only to allow control to accept QKeyEvent
selectByMouse: false
Keys.onPressed: {
if (event.key == Qt.Key_Return) {
mirrorText.text = "";
event.accepted = true;
}
}
}
MouseArea { // ... and we need this mouse area to prevent mirrorText from getting mouse events to ensure it will never get focus