diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2011-08-23 08:42:45 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2011-08-23 08:42:45 (GMT) |
commit | e410dad4f2ee6f381551303bd45651b3f0406e5a (patch) | |
tree | 6d27ec521a1c047b3951f2379fc90d17d689c02a /src/gui | |
parent | 564e6c02107a8b0db9a818c0a66affe94694ab39 (diff) | |
parent | 2f5855e8d891a7e93bdb721243f1c0b10fcb5ad9 (diff) | |
download | Qt-e410dad4f2ee6f381551303bd45651b3f0406e5a.zip Qt-e410dad4f2ee6f381551303bd45651b3f0406e5a.tar.gz Qt-e410dad4f2ee6f381551303bd45651b3f0406e5a.tar.bz2 |
Merge remote-tracking branch 'origin/4.8' into 4.8-tools-staging
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/inputmethod/qcoefepinputcontext_s60.cpp | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp index 33daa99..899b792 100644 --- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp +++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp @@ -64,6 +64,8 @@ #define QT_EAknCursorPositionChanged MAknEdStateObserver::EAknEdwinStateEvent(6) // MAknEdStateObserver::EAknActivatePenInputRequest #define QT_EAknActivatePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(7) +// MAknEdStateObserver::EAknClosePenInputRequest +#define QT_EAknClosePenInputRequest MAknEdStateObserver::EAknEdwinStateEvent(10) // EAknEditorFlagSelectionVisible is only valid from 3.2 onwards. // Sym^3 AVKON FEP manager expects that this flag is used for FEP-aware editors @@ -315,8 +317,9 @@ bool QCoeFepInputContext::filterEvent(const QEvent *event) if (!needsInputPanel()) return false; - if (event->type() == QEvent::CloseSoftwareInputPanel) { - m_fepState->ReportAknEdStateEventL(MAknEdStateObserver::EAknClosePenInputRequest); + if ((event->type() == QEvent::CloseSoftwareInputPanel) + && (QSysInfo::s60Version() > QSysInfo::SV_S60_5_0)) { + m_fepState->ReportAknEdStateEventL(QT_EAknClosePenInputRequest); return false; } @@ -1082,7 +1085,18 @@ TInt QCoeFepInputContext::DocumentLengthForFep() const return 0; QVariant variant = w->inputMethodQuery(Qt::ImSurroundingText); - return variant.value<QString>().size() + m_preeditString.size(); + + int size = variant.value<QString>().size() + m_preeditString.size(); + + // To fix an issue with backspaces not being generated if document size is zero, + // fake document length to be at least one always, except when dealing with + // hidden text widgets, where this faking would generate extra asterisk. Since the + // primary use of hidden text widgets is password fields, they are unlikely to + // support multiple lines anyway. + if (size == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText)) + size = 1; + + return size; } TInt QCoeFepInputContext::DocumentMaximumLengthForFep() const @@ -1165,6 +1179,12 @@ void QCoeFepInputContext::GetEditorContentForFep(TDes& aEditorContent, TInt aDoc // FEP expects the preedit string to be part of the editor content, so let's mix it in. int cursor = w->inputMethodQuery(Qt::ImCursorPosition).toInt(); text.insert(cursor, m_preeditString); + + // Add additional space to empty non-password text to compensate + // for the fake length we specified in DocumentLengthForFep(). + if (text.size() == 0 && !(m_textCapabilities & TCoeInputCapabilities::ESecretText)) + text += QChar(0x20); + aEditorContent.Copy(qt_QString2TPtrC(text.mid(aDocumentPosition, aLengthToRetrieve))); } |