Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.4.2
-
None
Description
Adding an Accessible.ignored: true attached property to a StackView element in a custom component can cause QAccessible::queryAccessibleInterface to be called during layout changes, as shown in this stack excerpt for an app that has statically linked with Qt:
00 MyApp!QFactoryLoader::metaData
01 MyApp!QFactoryLoader::indexOf
02 MyApp!QAccessible::queryAccessibleInterface
03 MyApp!QAccessibleEvent::accessibleInterface
04 MyApp!QAccessible::updateAccessibility
05 MyApp!QQuickItem::geometryChange
06 MyApp!QQuickLayout::geometryChange
The performance of QAccessible::queryAccessibleInterface for such a StackView can be significantly slow due to the absence of an InterfaceFactory and the lack of a QAccessiblePlugin. This cache miss incurs a significant cost and is repeated as the code traverses up the class hierarchy. Eventually, queryAccessibleInterface returns null, and this operation recurs for subsequent StackViews with the same class name, as the interface is not cached in QAccessibleCache.
Specifically, index is -1 and factory is null in the following code in QAccessible::queryAccessibleInterface in this scenario:
if (!qAccessiblePlugins()->contains(cn)) {
const int index = loader()->indexOf(cn);
if (index != -1) {
:
}
QAccessiblePlugin *factory = qAccessiblePlugins()->value(cn);
if (factory) {
:
Please make changes to improve performance in this function, because Accessible.ignored: true is unusable for such elements.