summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-09-28 10:21:49 +0200
committerAntti Kokko <antti.kokko@qt.io>2017-09-28 19:01:41 +0000
commit32218c3243fb4f0da83293c5bd6a663d8e3660ee (patch)
treeceb19b7430127942db7898702662648e75f6c065
parent960bebd61f70c39e2fbce9f67b889cd64f48cea7 (diff)
Make input method events work in QQuickWidgetv5.9.2
In change 0dbc575c1a8359534761167a5f5f1e29abedd51d, we removed the focusObject() reimplementation. However QWindow does not handle input method events: it relies on the IM sending events directly to the focus object. Task-number: QTBUG-61679 Change-Id: Ib79fbd7aa58a901a774ad97e9a17071f9c042480 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quickwidgets/qquickwidget.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index c23d11ed20..5aff0ee393 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -1391,8 +1391,6 @@ bool QQuickWidget::event(QEvent *e)
Q_D(QQuickWidget);
switch (e->type()) {
- case QEvent::InputMethod:
- case QEvent::InputMethodQuery:
case QEvent::TouchBegin:
case QEvent::TouchEnd:
@@ -1401,6 +1399,10 @@ bool QQuickWidget::event(QEvent *e)
// Touch events only have local and global positions, no need to map.
return QCoreApplication::sendEvent(d->offscreenWindow, e);
+ case QEvent::InputMethod:
+ case QEvent::InputMethodQuery:
+ return QCoreApplication::sendEvent(d->offscreenWindow->focusObject(), e);
+
case QEvent::WindowChangeInternal:
d->handleWindowChange();
break;