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

a11y: App with simple QWidget as toplevel lacks toplevel in AT-SPI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9.0 FF
    • None
    • Debian testing, qtbase self-compiled from commit 755733f5917b1389277b61336f8ca5a03873e446
    • Linux/Wayland, Linux/X11

    Description

      Qt doesn't require having a QDialog/QMainWindow/... as a top-level in the widget hierarchy, but allows having any QWidget as the top-level.
      Using a simple QWidget as the top-level however currently comes with the problem that the window isn't reflected in the accessibility hierarchy, as only widgets are reflected in the accessibility hierarchy, while QWindow is not.

      As a consequence, Qt apps using a simple QWidget as the top-level don't report any object with top-level role on the AT-SPI level, which is incorrect.

      Steps to reproduce:

      1. Build and run a simple sample program like the following:
      #include <QApplication>
      #include <QLabel>
      int main(int argc, char* argv[])
      {
          QApplication a(argc, argv);
          QLabel label("My label");
          label.show();
          return a.exec();
      }
      
      1. start Accerciser and take a look at the accessible hierarchy of the sample application

      Actual result
      The app only has a single top-level child with role "label"

      Expected result:
      The app should have a top-level object with the AT-SPI "frame" role to represent the window. That top-level object should have the object with role label as a child.

      Further information:

      #include <QApplication>
      #include <QLabel>
      #include <QMainWindow>
      int main(int argc, char* argv[])
      {
          QApplication a(argc, argv);
          QMainWindow window;
          QLabel* label = new QLabel("My label");
          window.setCentralWidget(label);
          window.show();
          return a.exec();
      }
      

      However, if Qt doesn't require app developers to have a "proper" top-level in the widget hierarchy, it should in my opinion still take care of exposing one on the accessibility level (e.g. for the associated QWindow).

      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
            michaelweghorn Michael Weghorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes