summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp7
-rw-r--r--tests/auto/qinputcontext/tst_qinputcontext.cpp3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 135b894..add3d17 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -236,6 +236,13 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
break;
}
+ QString widgetText = focusWidget()->inputMethodQuery(Qt::ImSurroundingText).toString();
+ int maxLength = focusWidget()->inputMethodQuery(Qt::ImMaximumTextLength).toInt();
+ if (!keyEvent->text().isEmpty() && widgetText.size() + m_preeditString.size() >= maxLength) {
+ // Don't send key events with string content if the widget is "full".
+ return true;
+ }
+
if (keyEvent->type() == QEvent::KeyPress
&& focusWidget()->inputMethodHints() & Qt::ImhHiddenText
&& !keyEvent->text().isEmpty()) {
diff --git a/tests/auto/qinputcontext/tst_qinputcontext.cpp b/tests/auto/qinputcontext/tst_qinputcontext.cpp
index c90cc5b..93813f9 100644
--- a/tests/auto/qinputcontext/tst_qinputcontext.cpp
+++ b/tests/auto/qinputcontext/tst_qinputcontext.cpp
@@ -932,9 +932,6 @@ void tst_QInputContext::symbianTestCoeFepInputContext()
QApplication::processEvents();
QCOMPARE(lineedit->text(), finalString);
- QEXPECT_FAIL("Numbers with movement, maxlength, password and unfinished text"
- , "Fails due to QTBUG-12949"
- , Continue);
QCOMPARE(ic->m_preeditString, preeditString);
#endif
}