diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-07-08 15:16:12 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-07-10 11:34:41 +0200 |
commit | 6ec35ff8c56222a317b838b6aac390eb6974de85 (patch) | |
tree | 64074b94cf024fd12c48b57a0cb8e7d88874e422 /tests/auto/other | |
parent | 60f706063aebee22f7fc1bb80f0003afb50fe73e (diff) |
a11y: Report app as parent for top-level item views
As happens for other widgets
(s. QAccessibleWidget::parentObject), report the app
as accessible parent for item views that don't
have another parent set.
Otherwise, the accessible tree is broken when
there's a top-level item view:
The application has the item view as a child,
but the child does not have any parent set.
Extend a QListView autotest accordingly.
Fixes: QTBUG-115135
Pick-to: 6.6 6.5
Change-Id: Ie06874681180a30fc6248dc98f80c4158d837278
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'tests/auto/other')
-rw-r--r-- | tests/auto/other/qaccessibility/tst_qaccessibility.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp index bc19ca4470..2fe8e0e5bd 100644 --- a/tests/auto/other/qaccessibility/tst_qaccessibility.cpp +++ b/tests/auto/other/qaccessibility/tst_qaccessibility.cpp @@ -2878,6 +2878,12 @@ void tst_QAccessibility::listTest() QCOMPARE(iface->indexOfChild(child3), 2); QCOMPARE(child3->text(QAccessible::Name), QString("Brisbane")); } + + // Check that application is accessible parent, since it's a top-level widget + QAccessibleInterface *parentIface = iface->parent(); + QVERIFY(parentIface); + QVERIFY(parentIface->role() == QAccessible::Application); + QTestAccessibility::clearEvents(); // Check for events |