summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-19 13:27:34 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-02-19 13:27:34 +0100
commit1e204ff6e91227de3bd2f105a1efbaf47ee2b5aa (patch)
tree1609ebd46902d5c568d3df08e593ff2b5919cbbc /src/webengine/api/qquickwebengineview.cpp
parent18b0081aeda8fcd5c2d756c47bdd63cb7f89e891 (diff)
parent8b048ef2ba4e8414f4852f791964878a6dc3f00f (diff)
Merge remote-tracking branch 'origin/5.14' into 5.15
Blacklisted one test requiring an update of qt5.git. Conflicts: .qmake.conf Change-Id: I75e55a1c5f8840cde55ddb60d632287b2affadeb
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 67d4142b9..8f5313a9d 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -753,26 +753,34 @@ QQuickWebEngineViewAccessible::QQuickWebEngineViewAccessible(QQuickWebEngineView
QAccessibleInterface *QQuickWebEngineViewAccessible::parent() const
{
QQuickItem *parent = engineView()->parentItem();
- return QAccessible::queryAccessibleInterface(parent);
+ QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(parent);
+ if (!iface)
+ return QAccessible::queryAccessibleInterface(engineView()->window());
+ return iface;
+}
+
+QAccessibleInterface *QQuickWebEngineViewAccessible::focusChild() const
+{
+ if (child(0) && child(0)->focusChild())
+ return child(0)->focusChild();
+ return const_cast<QQuickWebEngineViewAccessible *>(this);
}
int QQuickWebEngineViewAccessible::childCount() const
{
- if (engineView() && child(0))
- return 1;
- return 0;
+ return child(0) ? 1 : 0;
}
QAccessibleInterface *QQuickWebEngineViewAccessible::child(int index) const
{
- if (index == 0)
+ if (index == 0 && engineView())
return engineView()->d_func()->adapter->browserAccessible();
return 0;
}
int QQuickWebEngineViewAccessible::indexOfChild(const QAccessibleInterface *c) const
{
- if (c == child(0))
+ if (child(0) && c == child(0))
return 0;
return -1;
}
@@ -784,7 +792,7 @@ QString QQuickWebEngineViewAccessible::text(QAccessible::Text) const
QAccessible::Role QQuickWebEngineViewAccessible::role() const
{
- return QAccessible::Document;
+ return QAccessible::Client;
}
QAccessible::State QQuickWebEngineViewAccessible::state() const
@@ -945,10 +953,17 @@ void QQuickWebEngineViewPrivate::widgetChanged(RenderWidgetHostViewQtDelegateQui
{
Q_Q(QQuickWebEngineView);
- if (oldWidget)
+ if (oldWidget) {
oldWidget->setParentItem(nullptr);
+#if QT_CONFIG(accessibility)
+ QAccessible::deleteAccessibleInterface(QAccessible::uniqueId(QAccessible::queryAccessibleInterface(oldWidget)));
+#endif
+ }
if (newWidget) {
+#if QT_CONFIG(accessibility)
+ QAccessible::registerAccessibleInterface(new QtWebEngineCore::RenderWidgetHostViewQtDelegateQuickAccessible(newWidget, q));
+#endif
newWidget->setParentItem(q);
newWidget->setSize(q->boundingRect().size());
// Focus on creation if the view accepts it