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:
- Install QAccessibleTable as the default accessible interface for all subclasses of QAbstractItemView.
- 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!