diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-04-26 11:58:34 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-04-26 11:58:34 (GMT) |
commit | 507a819971cd0cb3d6acba96177ab3553dae9867 (patch) | |
tree | 378a9db1a86cb60e32e3425a7e4dcc9bba12ae04 | |
parent | 7616da319f0c64bf18900fe17ee3c6dd60496174 (diff) | |
download | Qt-507a819971cd0cb3d6acba96177ab3553dae9867.zip Qt-507a819971cd0cb3d6acba96177ab3553dae9867.tar.gz Qt-507a819971cd0cb3d6acba96177ab3553dae9867.tar.bz2 |
Input method hints are not correct if using proxy widget
Input context should prefer focus proxy over regular focus widget.
Task-number: QTBUG-18873
Reviewed-by: Miikka Heikkinen
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 92f8384..06dc25c 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -255,9 +255,13 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) // fall through intended case QEvent::KeyRelease: const QKeyEvent *keyEvent = static_cast<const QKeyEvent *>(event); + //If proxy exists, always use hints from proxy. + QWidget *proxy = focusWidget()->focusProxy(); + Qt::InputMethodHints currentHints = proxy ? proxy->inputMethodHints() : focusWidget()->inputMethodHints(); + switch (keyEvent->key()) { case Qt::Key_F20: - Q_ASSERT(m_lastImHints == focusWidget()->inputMethodHints()); + Q_ASSERT(m_lastImHints == currentHints); if (m_lastImHints & Qt::ImhHiddenText) { // Special case in Symbian. On editors with secret text, F20 is for some reason // considered to be a backspace. @@ -287,7 +291,7 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) } if (keyEvent->type() == QEvent::KeyPress - && focusWidget()->inputMethodHints() & Qt::ImhHiddenText + && currentHints & Qt::ImhHiddenText && !keyEvent->text().isEmpty()) { // Send some temporary preedit text in order to make text visible for a moment. m_preeditString = keyEvent->text(); @@ -588,9 +592,10 @@ void QCoeFepInputContext::updateHints(bool mustUpdateInputCapabilities) { QWidget *w = focusWidget(); if (w) { - Qt::InputMethodHints hints = w->inputMethodHints(); + QWidget *proxy = w->focusProxy(); + Qt::InputMethodHints hints = proxy ? proxy->inputMethodHints() : w->inputMethodHints(); - // Since splitview support works like an input method hint, yet it is private flag, + // Since splitview support works like an input method hint, yet it is private flag, // we need to update its state separately. if (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0) { TInt currentFlags = m_fepState->Flags(); |