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

Windows/Accessibility: Qt does not report correct focused widget to screen readers on Windows



    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.12.9, 5.15.1
    • Fix Version/s: None
    • Labels:
    • Platform/s:


      Repro steps:

      1. Using any version of Qt that supports UI Automation, create a dialog with at least one child widget (see below code sample)
      2. Open a screen reader such as NVDA (https://github.com/nvaccess/nvda http://nvda.bhvd.de/ ) or Narrator
      3. Show the dialog
      4. Observe

      Expected results:

      • The screen reader reads the name of the window and the focused widget (e.g. "Qt NVDA focus bug window, edit blank")
      • The screen reader's focus indicator is shown around the focused widget

      Actual results:

      • The screen reader reads the name of the window but not the focused widget
        • NVDA reads "Qt NVDA focus bug window, edit blank, Qt NVDA focus bug window"
        • Narrator reads "Qt NVDA focus bug window"
      • The screen reader's focus indicator is shown around the entire dialog contents, not the focused child widget

      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.
      • I only see this issue in Qt applications.  The UIA examples on MSDN do not exhibit this issue.
      • Interacting with the Qt focused widget doesn't cause the screen reader to read out the name of the focused widget.
      • The same issue can be seen in the Qt "http" example (in this case, I'm using 5.12.9 because I already had that installed)

      Code sample:


      #include <QApplication>
      #include <QHBoxLayout>
      #include <QLineEdit>
      #include <QPushButton>
      int main(int argc, char *argv[])
      	QApplication app(argc, argv);
      	QCoreApplication::setApplicationName("Qt NVDA focus bug");
      	QWidget window;
      	window.resize({ 300, 100 });
      	window.setLayout(new QHBoxLayout());
      	QLineEdit *edit = new QLineEdit();
      	QPushButton *button = new QPushButton("Browse...");
      	return app.exec();

      https://github.com/nvaccess/nvda/blob/master/source/_UIAHandler.py : 525


        1. creator_http_demo_nvda.png
          83 kB
          Mitchell Loftus
        2. narrator.png
          4 kB
          Mitchell Loftus
        3. nvda.png
          33 kB
          Mitchell Loftus
        4. qtbug90897_diag.diff
          20 kB
          Friedemann Kleint
        5. qtbug90897_log.txt
          16 kB
          Friedemann Kleint
        6. qtbug90897.zip
          3 kB
          Friedemann Kleint

          Issue Links

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



              anrocha André De La Rocha
              mloftus Mitchell Loftus
              PM Owner:
              Veli-Pekka Heinonen Veli-Pekka Heinonen
              0 Vote for this issue
              2 Start watching this issue



                  Gerrit Reviews

                  There are no open Gerrit changes