- Qt 5.3
- Accessibility
- Qt 5.3.2 Reference Documentation

Accessibility for QWidget Applications

# Accessibility

## Introduction

Accessibility in computer software is making applications usable for people with different abilities. It is important to take different people's needs into account, for example, in case of low vision, hearing, dexterity, or cognitive problems. Some examples of accessibility measures are keyboard shortcuts, a high-contrast user interface that uses specially selected colors and fonts, or support for assistive tools such as screen readers and braille displays.

A basic checklist that any application should aim for:

- Usability - Usability and user centric design generally lead to more usable applications, including improvements for people with various abilities.
- Fonts - Font settings should follow the system/platform. This allows users to select fonts for readability and increasing the font size.
- Colors - Provide enough contrast and consider the most common cases of low vision and color blindness. Make sure that the application is usable, for example, for people with red/green blindness, and don't depend on colors only.
- Scalable UI - A user interface that works in various sizes and properly supports different fonts and accommodates size changes.
- Sounds - Do not exclusively rely on sound notifications, provide a visual alternative when a sound signal is imperative to using the application.
- Spelling - Offer spell checking wherever it makes sense, even when only a single word is expected.
- Assistive Technology - Support the use of assistive tools (AT). Either use standard widgets/controls which support ATs out of the box, or make sure that your custom widgets and controls support accessibility properly. In order to learn more about this read on below.

This part of the documentation assumes that the basics for accessibility, which go hand in hand with usability, are already in good shape. The rest of this document focuses more specifically on supporting assistive technology.

Assistive Tools (or ATs) come in great variety and help users with different tasks. For this reason what individual applications offer (with the help of Qt) is a generic API that allows to inspect what is on screen in a semantic way and offers the typical interactions with the UI elements.

Applications do not usually communicate directly with the assistive tools, but through a platform specific API. Generally the communication with the ATs works though an IPC mechanism. Semantic information about user interface elements, such as buttons and scroll bars, is exposed to the assistive technologies. Qt supports Microsoft Active Accessibility (MSAA) and IAccessible2 on Windows, Mac OS X Accessibility on Mac OS X, and AT-SPI via DBus on Unix/X11. The platform specific technologies are abstracted by Qt, so that applications do not need any platform specific changes to work with the different native APIs. Qt tries to make adding accessibility support to your application as easy as possible, only a few changes from your side may be required to allow even more users to enjoy it.

The main reason to consult this documentation is to learn how to make custom QWidget subclasses and QQuickItems accessible.

In this overview document, we will examine the overall Qt accessibility architecture, and how to implement accessibility for custom widgets and elements.

## Making Applications Accessible

These two pages focus on giving an overview of how to achieve good accessibility:

Accessibility for QWidget Applications

Accessibility for Qt Quick Applications

These classes provide support for accessible applications:

QAccessible | The QAccessible class provides enums and static functions related to accessibility.
QAccessibleActionInterface | The QAccessibleActionInterface class implements support for invocable actions in the interface.
QAccessibleEvent | The QAccessibleEvent class is the base class for accessibility notifications.
QAccessibleInterface | The QAccessibleInterface class defines an interface that exposes information about accessible objects.
QAccessibleStateChangeEvent | The QAccessibleStateChangeEvent notfies the accessibility framework that the state of an object has changed.
QAccessibleTableCellInterface | The QAccessibleTableCellInterface class implements support for the IAccessibleTable2 Cell interface.
QAccessibleTableInterface | The QAccessibleTableInterface class implements support for the IAccessibleTable2 interface.
QAccessibleTableModelChangeEvent | The QAccessibleTableModelChangeEvent signifies a change in a table, list, or tree where cells are added or removed. If the change affected a number of rows, firstColumn and lastColumn will return -1. Likewise for columns, the row functions may return -1.
QAccessibleTextCursorEvent | The QAccessibleTextCursorEvent class notifies of cursor movements.
QAccessibleTextInsertEvent | The QAccessibleTextInsertEvent class notifies of text being inserted.
QAccessibleTextInterface | The QAccessibleTextInterface class implements support for text handling.
QAccessibleTextRemoveEvent | The QAccessibleTextRemoveEvent class notifies of text being deleted.
QAccessibleTextSelectionEvent | QAccessibleTextSelectionEvent signals a change in the text selection of an object.
QAccessibleTextUpdateEvent | The QAccessibleTextUpdateEvent class notifies about text changes. This is for accessibles that support editable text such as line edits. This event occurs for example when a portion of selected text gets replaced by pasting a new text or in override mode of editors.
QAccessibleValueChangeEvent | The QAccessibleValueChangeEvent describes a change in value for an accessible object.
QAccessibleValueInterface | The QAccessibleValueInterface class implements support for objects that manipulate a value.
QAccessibleObject | The QAccessibleObject class implements parts of the QAccessibleInterface for QObjects.
QAccessiblePlugin | The QAccessiblePlugin class provides an abstract base class for plugins provinding accessibility information for user interface elements.
Accessible | Enables accessibility of QML items
QAccessibleWidget | The QAccessibleWidget class implements the QAccessibleInterface for QWidgets.

Accessibility for QWidget Applications