summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2017-04-10 13:37:45 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2017-04-12 15:02:36 +0000
commit92993bc16ed81e0407e11a12781f3f1e0c4fd96a (patch)
tree540a8fec7b567016b3f9f09fba1b48e36ddb5009 /src
parent78417958b7172ec4968088fc3a908a219ed848f6 (diff)
Handle QInputMethodQueryEvent forwarded by RWHVQDW
Task-number: QTBUG-58362 Change-Id: I6c80c8063ccad97aa80aff8ee44aa10a899c5ff5 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/core/render_widget_host_view_qt.cpp16
-rw-r--r--src/core/render_widget_host_view_qt.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 619577d93..ab9fb66fb 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -917,6 +917,9 @@ bool RenderWidgetHostViewQt::forwardEvent(QEvent *event)
case QEvent::InputMethod:
handleInputMethodEvent(static_cast<QInputMethodEvent*>(event));
break;
+ case QEvent::InputMethodQuery:
+ handleInputMethodQueryEvent(static_cast<QInputMethodQueryEvent*>(event));
+ break;
default:
return false;
}
@@ -1258,6 +1261,19 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev)
}
}
+void RenderWidgetHostViewQt::handleInputMethodQueryEvent(QInputMethodQueryEvent *ev)
+{
+ Qt::InputMethodQueries queries = ev->queries();
+ for (uint i = 0; i < 32; ++i) {
+ Qt::InputMethodQuery query = (Qt::InputMethodQuery)(int)(queries & (1<<i));
+ if (query) {
+ QVariant v = inputMethodQuery(query);
+ ev->setValue(query, v);
+ }
+ }
+ ev->accept();
+}
+
#ifndef QT_NO_ACCESSIBILITY
void RenderWidgetHostViewQt::accessibilityActiveChanged(bool active)
{
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 78b946a60..304fa0e1a 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -192,6 +192,7 @@ public:
void handleHoverEvent(QHoverEvent*);
void handleFocusEvent(QFocusEvent*);
void handleInputMethodEvent(QInputMethodEvent*);
+ void handleInputMethodQueryEvent(QInputMethodQueryEvent*);
#if defined(OS_MACOSX)
virtual void SetActive(bool active) Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }