Our accessibilityWindow implementation asks the parent for it's window, expecting that it will always be the same. This is conceptually correct. However, as we don't represent windows through QAccessibilityInterface and instead rely on the natively provided element, the filtering out of ignored elements result in accessibilityParent return a null object once the parent is the window. Instead, check if we get an interface that represents a Window, and if so fall through to the code returning the NSView (after going through QAcessibilityInterface::window call, which was so far missing). And if we then get a Window element as the parent, then we don't have to call accessibilityWindow on that parent again. Instead, return the result directly and only keep going if we got some other element. Add a test case that confirms that we now get a valid result for the window attribute. Pick-to: 6.8 6.5 Fixes: QTBUG-137157 Change-Id: Ifa485734b290284bd5a1286e3b3c18454442fa10 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 5dc261357e44ac9e15423997748e28ae659a3623) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit c75046876642663acb58aed0998702bece8b1e12)
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%