aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgtextinput.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2011-09-07 19:58:14 +0200
committerLars Knoll <lars.knoll@nokia.com>2011-09-08 10:33:31 +0200
commit70cc5c9b7b420ecaf099d5d08fb1b4e8ad81a920 (patch)
tree104c52e5e150b4720a3759f0377366016cf1d03b /src/declarative/items/qsgtextinput.cpp
parent27fc1e1335a1b19f205fd5e08a1bd29dfebb2dee (diff)
Adapt to the input method changes in qtbase
Start using the QInputPanel instead of the QPlatformInputContext. Make sure we do something with both QInputMethodEvent and QInputMethodQueryEvent. This gets input methods partially working on TextInput fields. Change-Id: I4655f5599673325ffb75207573635afccd069a65 Reviewed-on: http://codereview.qt-project.org/4404 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Vesa Rantanen <vesa.rantanen@nokia.com> Reviewed-by: Andy Nichols Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/declarative/items/qsgtextinput.cpp')
-rw-r--r--src/declarative/items/qsgtextinput.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/declarative/items/qsgtextinput.cpp b/src/declarative/items/qsgtextinput.cpp
index 22ee3c805d..9974094e5b 100644
--- a/src/declarative/items/qsgtextinput.cpp
+++ b/src/declarative/items/qsgtextinput.cpp
@@ -52,9 +52,8 @@
#include <qsgtextnode_p.h>
#include <qsgsimplerectnode.h>
-#include <QtGui/qplatforminputcontext_qpa.h>
-#include <private/qguiapplication_p.h>
#include <QtGui/qstylehints.h>
+#include <QtGui/qinputpanel.h>
QT_BEGIN_NAMESPACE
@@ -1164,7 +1163,7 @@ void QSGTextInput::mouseReleaseEvent(QMouseEvent *event)
bool QSGTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event)
{
#if !defined QT_NO_IM
- if (control->composeMode()) {
+ if (control->composeMode() && event->type() == QEvent::KeyRelease) {
int tmp_cursor = xToPos(event->localPos().x());
int mousePos = tmp_cursor - control->cursor();
if (mousePos < 0 || mousePos > control->preeditAreaText().length()) {
@@ -1174,10 +1173,8 @@ bool QSGTextInputPrivate::sendMouseEventToInputContext(QMouseEvent *event)
return true;
}
- QPlatformInputContext *ic = QGuiApplicationPrivate::platformIntegration()->inputContext();
- if (ic)
- // may be causing reset() in some input methods
- ic->mouseHandler(mousePos, event);
+ // may be causing reset() in some input methods
+ qApp->inputPanel()->invokeAction(QInputPanel::Click, mousePos);
if (!control->preeditAreaText().isEmpty())
return true;
}