summaryrefslogtreecommitdiffstats
path: root/src/gui/inputmethod
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2010-09-27 11:37:14 (GMT)
committeraxis <qt-info@nokia.com>2010-09-27 13:24:58 (GMT)
commit3bb3af84bef3c0472ca8ed0d5c6bb3c82320956d (patch)
treebe484a04b35a79e9c1f0079717d30d6e10b30e0e /src/gui/inputmethod
parent1e4f736c2825c8c36ec74719efbc723f6374d072 (diff)
downloadQt-3bb3af84bef3c0472ca8ed0d5c6bb3c82320956d.zip
Qt-3bb3af84bef3c0472ca8ed0d5c6bb3c82320956d.tar.gz
Qt-3bb3af84bef3c0472ca8ed0d5c6bb3c82320956d.tar.bz2
Fixed regression when typing in QTextControl based widgets on Symbian
The bug was that when querying for the maximum text length, the case where an invalid QVariant was returned (which is allowed) was not handled properly. This would lead to input being blocked by the input context when it shouldn't. RevBy: Sami Merila
Diffstat (limited to 'src/gui/inputmethod')
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index af86d77..4a1b9b9 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -238,8 +238,10 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event)
}
QString widgetText = focusWidget()->inputMethodQuery(Qt::ImSurroundingText).toString();
- int maxLength = focusWidget()->inputMethodQuery(Qt::ImMaximumTextLength).toInt();
- if (!keyEvent->text().isEmpty() && widgetText.size() + m_preeditString.size() >= maxLength) {
+ bool validLength;
+ int maxLength = focusWidget()->inputMethodQuery(Qt::ImMaximumTextLength).toInt(&validLength);
+ if (!keyEvent->text().isEmpty() && validLength
+ && widgetText.size() + m_preeditString.size() >= maxLength) {
// Don't send key events with string content if the widget is "full".
return true;
}