From: Pekka Vuorela Date: Wed, 7 Sep 2011 17:55:38 +0000 (+0300) Subject: Explicitly ask input method to commit preedit when focus lost. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=99e4a2a4a8a6337e7d97f82e7bbabcdd98fd13f5;p=konrad%2Fqtdeclarative.git Explicitly ask input method to commit preedit when focus lost. Takes advantage of new QInputPanel::commit() method. Change-Id: I0f09353c6ac7f5503ea9fda3a9bd79d0ae3da940 Reviewed-on: http://codereview.qt-project.org/4456 Reviewed-by: Qt Sanity Bot Reviewed-by: Lars Knoll --- diff --git a/src/declarative/items/qsgcanvas.cpp b/src/declarative/items/qsgcanvas.cpp index bf22dfa..575a828 100644 --- a/src/declarative/items/qsgcanvas.cpp +++ b/src/declarative/items/qsgcanvas.cpp @@ -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; diff --git a/src/declarative/items/qsgcanvas_p.h b/src/declarative/items/qsgcanvas_p.h index d73c57d..128743e 100644 --- a/src/declarative/items/qsgcanvas_p.h +++ b/src/declarative/items/qsgcanvas_p.h @@ -142,7 +142,6 @@ public: void renderSceneGraph(const QSize &size); void updateInputContext(); - void resetInputContext(); QSGItem::UpdatePaintNodeData updatePaintNodeData;