summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-04-06 13:52:34 +0300
committerSami Merila <sami.merila@nokia.com>2011-04-06 13:52:34 +0300
commitf870613ee5632c1af87a71948dc302015d1a1d75 (patch)
treeb2d6895de409cc11f9362721cfc3d5414bb89ad7 /src/gui/inputmethod
parent47b03704fd906ec95dfab920d2db20726fd91700 (diff)
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
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 2c70ade296..3b5290cea1 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);
}