summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2011-04-14 10:22:36 (GMT)
committerSami Merila <sami.merila@nokia.com>2011-04-14 10:22:36 (GMT)
commit8a37a69c961092aae7dd7f55f30a15b3fae1b7cc (patch)
tree4f31aa785acc88815adedbf3c11aaabad8c33e30
parentf4dedf1a4d7e530c715f99327da175cec67d66e4 (diff)
downloadQt-8a37a69c961092aae7dd7f55f30a15b3fae1b7cc.zip
Qt-8a37a69c961092aae7dd7f55f30a15b3fae1b7cc.tar.gz
Qt-8a37a69c961092aae7dd7f55f30a15b3fae1b7cc.tar.bz2
Splitview flag should also be updated to inputcontext
Currently splitview support is defined in exported global private method. There is no guarantee that input context is created, or updated when the API is called. This is problematic, since the client need to find a correct place and time when to call the API. As a change, update existing input context when the API is called. Also, take into account the splitview flag when updating input context. This ensures that client can enforce the flag use correctly. Task-number: QTBUG-18715 Reviewed-by: Guoqing Zhang
-rw-r--r--src/gui/inputmethod/qcoefepinputcontext_s60.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
index e4b965b..c11d5e8 100644
--- a/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
+++ b/src/gui/inputmethod/qcoefepinputcontext_s60.cpp
@@ -77,6 +77,15 @@ QT_BEGIN_NAMESPACE
Q_GUI_EXPORT void qt_s60_setPartialScreenInputMode(bool enable)
{
S60->partial_keyboard = enable;
+
+ QInputContext *ic = 0;
+ if (QApplication::focusWidget()) {
+ ic = QApplication::focusWidget()->inputContext();
+ } else if (qApp && qApp->inputContext()) {
+ ic = qApp->inputContext();
+ }
+ if (ic)
+ ic->update();
}
QCoeFepInputContext::QCoeFepInputContext(QObject *parent)
@@ -580,6 +589,19 @@ void QCoeFepInputContext::updateHints(bool mustUpdateInputCapabilities)
QWidget *w = focusWidget();
if (w) {
Qt::InputMethodHints hints = w->inputMethodHints();
+
+ // 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();
+ if (S60->partial_keyboard)
+ currentFlags |= QT_EAknEditorFlagEnablePartialScreen;
+ else
+ currentFlags &= ~QT_EAknEditorFlagEnablePartialScreen;
+ if (currentFlags != m_fepState->Flags())
+ m_fepState->SetFlags(currentFlags);
+ }
+
if (hints != m_lastImHints) {
m_lastImHints = hints;
applyHints(hints);