Added QInputPanel::commit()
authorPekka Vuorela <pekka.ta.vuorela@nokia.com>
Wed, 7 Sep 2011 17:57:00 +0000 (20:57 +0300)
committerLars Knoll <lars.knoll@nokia.com>
Thu, 8 Sep 2011 08:32:15 +0000 (10:32 +0200)
To be called when input context is expected to commit what it had as
preedit, and resetting its state. Earlier this was done with ::reset()
when in fact documentation somewhat disallowed doing so.

Change-Id: I10ad0620aa42fce6d01a69265af8a4f5f9f4d397
Reviewed-on: http://codereview.qt-project.org/4401
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Vesa Rantanen <vesa.rantanen@nokia.com>
src/gui/kernel/qinputpanel.cpp
src/gui/kernel/qinputpanel.h
src/gui/kernel/qplatforminputcontext_qpa.cpp
src/gui/kernel/qplatforminputcontext_qpa.h

index a11a5d4..5219ade 100644 (file)
@@ -162,6 +162,13 @@ void QInputPanel::reset()
         ic->reset();
 }
 
+void QInputPanel::commit()
+{
+    QPlatformInputContext *ic = QGuiApplicationPrivate::platformIntegration()->inputContext();
+    if (ic)
+        ic->commit();
+}
+
 void QInputPanel::invokeAction(Action a, int cursorPosition)
 {
     QPlatformInputContext *ic = QGuiApplicationPrivate::platformIntegration()->inputContext();
index b0f0e23..c16a18e 100644 (file)
@@ -97,6 +97,7 @@ public Q_SLOTS:
 
     void update(Qt::InputMethodQueries queries);
     void reset();
+    void commit();
 
     void invokeAction(Action a, int cursorPosition);
 
index 3280083..328d4f5 100644 (file)
@@ -56,6 +56,10 @@ void QPlatformInputContext::reset()
 {
 }
 
+void QPlatformInputContext::commit()
+{
+}
+
 void QPlatformInputContext::update(Qt::InputMethodQueries)
 {
 }
index 3bdce73..1720e63 100644 (file)
@@ -60,6 +60,7 @@ public:
     virtual ~QPlatformInputContext();
 
     virtual void reset();
+    virtual void commit();
     virtual void update(Qt::InputMethodQueries);
     virtual void invokeAction(QInputPanel::Action, int cursorPosition);