From f870613ee5632c1af87a71948dc302015d1a1d75 Mon Sep 17 00:00:00 2001 From: Sami Merila Date: Wed, 6 Apr 2011 13:52:34 +0300 Subject: Not possible to enter negative values to widgets with numeric fields Currently it is not possible to enter negative number to QSpinBox (or to any other QWidget which is handling numeric input only) in touch devices. This is due to that AVKON virtual keyboards have negative sign (-) in special character table(s) and it is not accessible by default from QWidgets, unless you define widget's input hints as ImhFormattedNumbersOnly AND ImhDialableCharactersOnly (or non-numeric). With this fix, default special character table is added for widgets with numeric input mode AND either ImhFormattedNumbersOnly or ImhDialableCharactersOnly. By default user is still unable to enter nagative values to QSpinBox, but developer can set inputMethodHint to work around the issue: widget->setInputMethodHints(Qt::ImhFormattedNumbersOnly); Task-number: QTBUG-17461 Reviewed-by: Miikka Heikkinen --- src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 2c70ade..3b5290c 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -726,6 +726,8 @@ void QCoeFepInputContext::applyHints(Qt::InputMethodHints hints) m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_EMAIL_ADDR_SPECIAL_CHARACTER_TABLE_DIALOG); } else if (needsCharMap) { m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); + } else if ((hints & ImhFormattedNumbersOnly) || (hints & ImhDialableCharactersOnly)) { + m_fepState->SetSpecialCharacterTableResourceId(R_AVKON_SPECIAL_CHARACTER_TABLE_DIALOG); } else { m_fepState->SetSpecialCharacterTableResourceId(0); } -- cgit v0.12