Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-116687

Adding Accessible.ignored: true property can cause bad QAccessible::queryAccessibleInterface perf

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.4.2
    • None
    • Windows

    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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            vinocher V V
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes