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/kitemviews/kitemlistviewaccessible.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/kitemviews/kitemlistviewaccessible.h') diff --git a/src/kitemviews/kitemlistviewaccessible.h b/src/kitemviews/kitemlistviewaccessible.h index 628c32fc2..41aacf367 100644 --- a/src/kitemviews/kitemlistviewaccessible.h +++ b/src/kitemviews/kitemlistviewaccessible.h @@ -18,11 +18,12 @@ class KItemListView; class KItemListContainer; +class KItemListContainerAccessible; class DOLPHIN_EXPORT KItemListViewAccessible : public QAccessibleObject, public QAccessibleTableInterface { public: - explicit KItemListViewAccessible(KItemListView *view); + explicit KItemListViewAccessible(KItemListView *view, KItemListContainerAccessible *parent); ~KItemListViewAccessible() override; void *interface_cast(QAccessible::InterfaceType type) override; @@ -81,6 +82,8 @@ private: QAccessible::Id id; }; mutable QVector m_cells; + + KItemListContainerAccessible *m_parent; }; class DOLPHIN_EXPORT KItemListAccessibleCell : public QAccessibleInterface, public QAccessibleTableCellInterface -- cgit v1.3.1