summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2020-01-20 11:02:03 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2020-03-02 08:14:14 +0100
commit171bdc9f0e9a563b0d70643637d0b6a8e5661d17 (patch)
tree25960d1b7c74ca4de4e62c44a056ca326bc155e6
parent19444168395424fef4daff76ce64b9813aef0610 (diff)
Update accessibility focus on FocusIn events for Quick
Without this, an already focused web element might not be read when QQuickWebEngineView gets the active focus. QWidget::setFocus() does this for Widget. Fixes: QTBUG-81539 Change-Id: Iaa418c416871e580583ea05e50b223dea3501fd8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
index e2ce08ebf..d5aae271f 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -226,6 +226,13 @@ bool RenderWidgetHostViewQtDelegateQuick::event(QEvent *event)
void RenderWidgetHostViewQtDelegateQuick::focusInEvent(QFocusEvent *event)
{
+#if QT_CONFIG(accessibility)
+ if (QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(this)->focusChild()) {
+ QAccessibleEvent focusEvent(iface, QAccessible::Focus);
+ QAccessible::updateAccessibility(&focusEvent);
+ }
+#endif // QT_CONFIG(accessibility)
+
m_client->forwardEvent(event);
}