Added QInputPanel::commit()

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>
This commit is contained in:
Pekka Vuorela 2011-09-07 20:57:00 +03:00 committed by Lars Knoll
parent 53d549fe76
commit 6d9d1e78f4
4 changed files with 13 additions and 0 deletions

View 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();

View File

@ -97,6 +97,7 @@ public Q_SLOTS:
void update(Qt::InputMethodQueries queries);
void reset();
void commit();
void invokeAction(Action a, int cursorPosition);

View File

@ -56,6 +56,10 @@ void QPlatformInputContext::reset()
{
}
void QPlatformInputContext::commit()
{
}
void QPlatformInputContext::update(Qt::InputMethodQueries)
{
}

View 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);