From 212ff4f34de927d1efb4845654b74d4bba8d73b7 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Tue, 22 Jan 2013 17:18:36 +0100 Subject: [PATCH] Add multi-line input method hint Enabler for input on Android. Change-Id: I44670b95b35f773814125c5d35c67e9713567813 Reviewed-by: BogDan Vatra Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/global/qnamespace.h | 2 ++ src/corelib/global/qnamespace.qdoc | 2 ++ src/widgets/widgets/qtextedit.cpp | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index c8a615a1f7..6f977d847d 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1305,6 +1305,8 @@ public: ImhPreferLatin = 0x200, + ImhMultiLine = 0x400, + ImhDigitsOnly = 0x10000, ImhFormattedNumbersOnly = 0x20000, ImhUppercaseOnly = 0x40000, diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 248cdbce96..e1c64aab94 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -2330,6 +2330,8 @@ \value ImhTime The text editor functions as a time field. \value ImhPreferLatin Latin characters are preferred (but not required). + \value ImhMultiLine Multiple lines can be entered into the text field. + Flags that restrict input (exclusive flags): \value ImhDigitsOnly Only digits are allowed. diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index f033b6544c..a79cea31a1 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -182,7 +182,7 @@ void QTextEditPrivate::init(const QString &html) q->setFocusPolicy(Qt::WheelFocus); q->setAttribute(Qt::WA_KeyCompression); q->setAttribute(Qt::WA_InputMethodEnabled); - + q->setInputMethodHints(Qt::ImhMultiLine); #ifndef QT_NO_CURSOR viewport->setCursor(Qt::IBeamCursor); #endif