Merge pull request #11575 from ElderOrb/QTBUG-49297

workaround for https://bugreports.qt.io/browse/QTBUG-49297
This commit is contained in:
Zach Fox 2017-10-12 10:56:45 -07:00 committed by GitHub
commit 1227168939

View file

@ -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) {