From 549fad2daeeccac53b88b4777dcc9effbc2110e5 Mon Sep 17 00:00:00 2001 From: Felix Ernst Date: Mon, 17 Jul 2023 17:13:51 +0300 Subject: Fix accessibility ancestor tree Before this commit, KItemListViewAccessible would always return nullptr as its parent. This meant that accessibility software would have to guess to which window/hierarchy the KItemListView belongs to. Guessing shouldn't be necessary here. This commit makes sure that the KItemListView always returns a sensible parent in the accessible hierarchy. It does so by explicitly setting the accessible parent for every KItemListView after construction in the DolphinView contructor. Since KItemListView now always knows about its accessible parent, the accessibleInterfaceFactory can always ask the KItemListView for that information when constructing the QAccessibleInterfaces. Fixes https://invent.kde.org/system/dolphin/-/issues/47. --- src/views/dolphinview.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/views') diff --git a/src/views/dolphinview.cpp b/src/views/dolphinview.cpp index 21e23d5ac..d8eab142d 100644 --- a/src/views/dolphinview.cpp +++ b/src/views/dolphinview.cpp @@ -129,6 +129,9 @@ DolphinView::DolphinView(const QUrl &url, QWidget *parent) m_container = new KItemListContainer(controller, this); m_container->installEventFilter(this); +#ifndef QT_NO_ACCESSIBILITY + m_view->setAccessibleParentsObject(m_container); +#endif setFocusProxy(m_container); connect(m_container->horizontalScrollBar(), &QScrollBar::valueChanged, this, [=] { hideToolTip(); -- cgit v1.3