summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-09-01 11:53:32 (GMT)
committeraxis <qt-info@nokia.com>2010-09-01 13:09:46 (GMT)
commit5ca6264933af60b3cd376b7f08bea008fa69b515 (patch)
tree19849b13b22d53b50973c983c4df385cfe253ada /src/gui/inputmethod
parentf0ec1d2ec229f5a2c47dfa9392a2625da25fc69f (diff)
downloadQt-5ca6264933af60b3cd376b7f08bea008fa69b515.zip
Qt-5ca6264933af60b3cd376b7f08bea008fa69b515.tar.gz
Qt-5ca6264933af60b3cd376b7f08bea008fa69b515.tar.bz2
Fixed input context trying to squeeze content into a full widget.
Problem was reproduced on N97. If the FEP detects that the widget is full while still editing text, it will try to send those events as key events instead. Since this screws up the content in the widget, we stop those events from reaching the widget in the input context. AutoTest: Passed Task: QTBUG-12949 RevBy: Miikka Heikkinen
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp7
1 files changed, 7 insertions, 0 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()) {