Explicitly ask input method to commit preedit when focus lost.
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>
Wed, 7 Sep 2011 17:55:38 +0000 (20:55 +0300)
committerLars Knoll <lars.knoll@nokia.com>
Thu, 8 Sep 2011 14:07:23 +0000 (16:07 +0200)
Takes advantage of new QInputPanel::commit() method.

Change-Id: I0f09353c6ac7f5503ea9fda3a9bd79d0ae3da940
Reviewed-on: http://codereview.qt-project.org/4456
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
src/declarative/items/qsgcanvas.cpp
src/declarative/items/qsgcanvas_p.h

index bf22dfa..575a828 100644 (file)
@@ -349,15 +349,6 @@ void QSGCanvasPrivate::updateInputContext()
     // ### finer grained updates would be good
     qApp->inputPanel()->update(Qt::ImQueryAll);
 }
-/*!
-    This function is an attempt to localize all uses of QInputContext::reset in
-    one place up until the point where we have public API for the QInputContext API.
- */
-void QSGCanvasPrivate::resetInputContext()
-{
-    qApp->inputPanel()->reset();
-}
-
 
 void QSGCanvasPrivate::initializeSceneGraph()
 {
@@ -552,7 +543,7 @@ void QSGCanvasPrivate::setFocusInScope(QSGItem *scope, QSGItem *item, FocusOptio
 
         if (oldActiveFocusItem) {
 #ifndef QT_NO_IM
-            resetInputContext();
+            qApp->inputPanel()->commit();
 #endif
 
             activeFocusItem = 0;
@@ -661,7 +652,7 @@ void QSGCanvasPrivate::clearFocusInScope(QSGItem *scope, QSGItem *item, FocusOpt
         Q_ASSERT(oldActiveFocusItem);
 
 #ifndef QT_NO_IM
-        resetInputContext();
+        qApp->inputPanel()->commit();
 #endif
 
         activeFocusItem = 0;
index d73c57d..128743e 100644 (file)
@@ -142,7 +142,6 @@ public:
     void renderSceneGraph(const QSize &size);
 
     void updateInputContext();
-    void resetInputContext();
 
     QSGItem::UpdatePaintNodeData updatePaintNodeData;