summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-04-26 14:58:34 +0300
committerSami Merila <sami.merila@nokia.com>2011-04-26 14:58:34 +0300
commit507a819971cd0cb3d6acba96177ab3553dae9867 (patch)
tree378a9db1a86cb60e32e3425a7e4dcc9bba12ae04
parent7616da319f0c64bf18900fe17ee3c6dd60496174 (diff)
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.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index 92f83844d7..06dc25c708 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();