summaryrefslogtreecommitdiffstats
path: root/tests/auto/qinputcontext
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-09-09 11:48:58 (GMT)
committeraxis <qt-info@nokia.com>2010-09-10 09:49:26 (GMT)
commit5cef786a651c675d3428060a19bfd9d9ecee6083 (patch)
tree4df602ce7e0d4911db31e36af6d1deee0f327067 /tests/auto/qinputcontext
parentf82cee5501d5c76aebe8475ff47b334962b42c21 (diff)
downloadQt-5cef786a651c675d3428060a19bfd9d9ecee6083.zip
Qt-5cef786a651c675d3428060a19bfd9d9ecee6083.tar.gz
Qt-5cef786a651c675d3428060a19bfd9d9ecee6083.tar.bz2
Fixed crash in input methods when using symbols menu and numbers only
When inputting only numbers, the symbol menu should not do anything. However in the old code the resource id of the symbol table was still being set, so the symbol key on N97 would look up a table that was not valid for the current input mode and crash. Fixed by setting the symbol table id to zero under those conditions. RevBy: Sami Merila Task: QTBUG-13472 AutoTest: Included
Diffstat (limited to 'tests/auto/qinputcontext')
-rw-r--r--tests/auto/qinputcontext/tst_qinputcontext.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp
index 52e655b..d077bc1 100644
--- a/tests/auto/qinputcontext/tst_qinputcontext.cpp
+++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp
@@ -884,6 +884,27 @@ void tst_QInputContext::symbianTestCoeFepInputContext_data()
<< QString("44")
<< QString("");
events.clear();
+
+ // Test that the symbol key successfully does nothing when in number-only mode.
+ events << FepReplayEvent(EEventKeyDown, EStdKeyLeftFunc, 0, 0, 0);
+ events << FepReplayEvent(EEventKeyUp, EStdKeyLeftFunc, 0, 0, 0);
+ QTest::newRow("Dead symbols key")
+ << true
+ << Qt::InputMethodHints(Qt::ImhDigitsOnly)
+ << 0
+ << QLineEdit::Normal
+ << events
+ << QString("")
+ << QString("");
+ QTest::newRow("Dead symbols key and password")
+ << true
+ << Qt::InputMethodHints(Qt::ImhDigitsOnly)
+ << 0
+ << QLineEdit::Password
+ << events
+ << QString("")
+ << QString("");
+ events.clear();
#endif
}