From dcdf85b08ed0fee5e56818c27f65b96415bd1530 Mon Sep 17 00:00:00 2001 From: beholder Date: Thu, 12 Oct 2017 00:11:27 +0300 Subject: [PATCH] workaround for https://bugreports.qt.io/browse/QTBUG-49297 --- interface/resources/qml/controls-uit/TextField.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/interface/resources/qml/controls-uit/TextField.qml b/interface/resources/qml/controls-uit/TextField.qml index 1cc4d0ecc1..e636bfc27f 100644 --- a/interface/resources/qml/controls-uit/TextField.qml +++ b/interface/resources/qml/controls-uit/TextField.qml @@ -39,6 +39,20 @@ TextField { y: textFieldLabel.visible ? textFieldLabel.height + textFieldLabel.anchors.bottomMargin : 0 + // workaround for https://bugreports.qt.io/browse/QTBUG-49297 + Keys.onPressed: { + switch (event.key) { + case Qt.Key_Return: + case Qt.Key_Enter: + event.accepted = true; + + // emit accepted signal manually + if (acceptableInput) { + accepted(); + } + } + } + style: TextFieldStyle { textColor: { if (isLightColorScheme) {