diff options
author | Samuel Nevala <samuel.nevala@digia.com> | 2014-10-22 14:49:33 +0300 |
---|---|---|
committer | Samuel Nevala <samuel.nevala@digia.com> | 2014-10-25 07:19:35 +0200 |
commit | 3f9dbc0ec82e1c7c823707668fcd326d8a1dd82b (patch) | |
tree | 6792f940387f927b94da52928944a7a1a43ada1e /src/widgets | |
parent | 27a321e1ed929a3de72ede000a38d95f98f68150 (diff) | |
download | qtbase-3f9dbc0ec82e1c7c823707668fcd326d8a1dd82b.tar.gz |
Android: Keyboard doesn't hide from done button
QLineEdit commits and hides QInputMethod on enter key press. When
Qt::ImhMultiLine input method hint is set, virtual keyboard is not
hidden.
Task-number: QTBUG-37850
Change-Id: I018351caa18bd2116665771e5f024a57182a01b9
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/widgets/qwidgetlinecontrol.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp index 90fbfc1639..a82dd99591 100644 --- a/src/widgets/widgets/qwidgetlinecontrol.cpp +++ b/src/widgets/widgets/qwidgetlinecontrol.cpp @@ -1607,6 +1607,13 @@ void QWidgetLineControl::processKeyEvent(QKeyEvent* event) if (event->key() == Qt::Key_Enter || event->key() == Qt::Key_Return) { if (hasAcceptableInput() || fixup()) { + + QInputMethod *inputMethod = QApplication::inputMethod(); + inputMethod->commit(); + QWidget *lineEdit = qobject_cast<QWidget *>(parent()); + if (!(lineEdit && lineEdit->inputMethodHints() & Qt::ImhMultiLine)) + inputMethod->hide(); + emit accepted(); emit editingFinished(); } |