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

Implement accessibility for subclasses of QAbstractItemView

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.1
    • None
    • All environments on desktop platforms (Windows, macOS, Linux).

    • All

    Description

      Qt provides accessible interfaces for its built-in item views:

      • QAccessibleTable provides accessibility for QListView and QTableView
      • QAccessibleTree provides accessibility QTreeView

      Unfortunately, no accessibility is provided for custom item views (i.e. user-created classes that derive from QAbstractItemView) despite the fact that the model structure is unchanged.

       Instead, Qt users are forced to implement their own accessibility by deriving from QAccessibleInterface, QAccessibleTableInterface, and friends. This requires a lot of effort to get right, and the reality is that most people won't bother to do it. This means most custom views are likely to be inaccessible.

      If a Qt user does go to the effort of creating a custom accessibility interface for a custom item view, the end result is likely to be very similar to QAccessibleTable or QAccessibleTree. In fact, I have tried using QAccessibleTable as an interface for the Pie Chart Example (which derrives from QAbstractItemView) and found accessibility works perfectly well! However, I had to compile QAccessibleTable myself since it is not part of the public API.

       This problem can be resolved by either (or both!) of the following:

      1. Install QAccessibleTable as the default accessible interface for all subclasses of QAbstractItemView.
      2. Add QAccessibleTable and QAccessibleTree to the public API so that Qt users can install them manually in custom interface factory functions.

      This approach might not work for all item view, as some might be very complicated or have other requirements. In those cases it will still be necessary for Qt users to implement accessibity the hard way (inherit from QAccessibleInterface, etc.), but for the majority if cases it should be good enough to borrow QAccessibleTable, and I think we can all agree that some accessibility is better than none!

      Attachments

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

        Activity

          People

            smd Jan Arve
            shoogle Peter Jonas
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes