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

Windows/Accessibility: Focused QListWidget is not announced by screen readers

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      f1eccab04e01b3acc1a4b4c6a5fe7b3af3e2dcba (qt/qtbase/dev) da7c44770f0ff0ca5f114b65efc61093226d96de (qt/qtbase/6.0) 7432281cc9647f7252eb579e1289220e79a66a1f (qt/qtbase/6.1) 97ee332ee6b95937c78b7cd4dbb5a03120e56f26 (qt/tqtc-qtbase/5.15)

      Description

      Repro steps:

      1. Using any version of Qt that supports UI Automation, create a dialog with a QListWidget
      2. Open a screen reader such as NVDA (https://github.com/nvaccess/nvda http://nvda.bhvd.de/ ) or Narrator
      3. Show the dialog
      4. Use Tab to focus the QListWidget
      5. Observe

      Expected results:

      • The screen reader reads the name of the QListWidget and the selected list item(s) (e.g. "Items list, Item 1, 1of 4, selected")
      • The screen reader's focus indicator is shown around the selected list item

      Actual results:

      • The screen reader reads nothing (this is true of both NVDA and Narrator)
      • The screen reader's focus indicator is shown around the previously focused widget, not the currently focused QListWidget

      Additional info:

      • I am upgrading an application from 5.9.3 (MSAA accessibility backend) to 5.15.1 (UIA accessibility backend).¬† Both NVDA and Narrator behave as expected in 5.9.3.

      Code sample:

      #include <QApplication>
      #include <QListWidget>
      #include <QPushButton>
      #include <QVBoxLayout>
      
      int main(int argc, char *argv[])
      {
      	QApplication app(argc, argv);
      	QCoreApplication::setApplicationName("Qt NVDA list widget bug");
      
      	QWidget window;
      	window.resize({ 300, 100 });
      	window.setLayout(new QVBoxLayout());
      
      	QListWidget* list = new QListWidget();
      	list->setAccessibleName("Items");
      	window.layout()->addWidget(list);
      
      	for (int i = 1; i < 5; ++i)
      	{
      		const QString name = QString("Item %1").arg(i);
      		list->addItem(new QListWidgetItem(name));
      	}
      	list->item(0)->setSelected(true);
      
      	QPushButton *button = new QPushButton("OK");
      	window.layout()->addWidget(button);
      
      	window.show();
      
      	return app.exec();
      }
      

        Attachments

        1. narrator.png
          10 kB
          Mitchell Loftus
        2. nvda.png
          31 kB
          Mitchell Loftus
        3. qtbug91029.zip
          2 kB
          Friedemann Kleint

          Issue Links

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

            Activity

              People

              Assignee:
              anrocha André De La Rocha
              Reporter:
              mloftus Mitchell Loftus
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes