|  | Home · Overviews · Examples |

# QAccessibleInterface Class Reference
[com.trolltech.qt.gui module]

The `QAccessibleInterface` class defines an interface that exposes information about accessible objects. More...

Inherits `QAccessible`.

Inherited by `QAccessibleInterfaceEx` and `QAccessibleObject`.

## Detailed Description

The `QAccessibleInterface` class defines an interface that exposes information about accessible objects.

Accessibility tools (also called AT Clients), such as screen readers or braille displays, require high-level information about accessible objects in an application. Accessible objects provide specialized input and output methods, making it possible for users to use accessibility tools with enabled applications (AT Servers).

Every element that the user needs to interact with or react to is an accessible object, and should provide this information. These are mainly visual objects, such as widgets and widget elements, but can also be content, such as sounds.

The AT client uses three basic concepts to acquire information about any accessible object in an application:

- Properties The client can read information about accessible objects. In some cases the client can also modify these properties; such as text in a line edit.
- Actions The client can invoke actions like pressing a button or .
- Relationships and Navigation The client can traverse from one accessible object to another, using the relationships between objects.

The `QAccessibleInterface` defines the API for these three concepts.

### Relationships and Navigation

The functions `childCount` and `indexOfChild` return the number of children of an accessible object and the index a child object has in its parent. The `childAt` function returns the index of a child at a given position.

The `relationTo` function provides information about how two different objects relate to each other, and `navigate` allows traversing from one object to another object with a given relationship.

### Properties

The central property of an accessible objects is what `role` it has. Different objects can have the same role, e.g. both the "Add line" element in a scroll bar and the `OK` button in a dialog have the same role, "button". The role implies what kind of interaction the user can perform with the user interface element.

An object's `state` property is a combination of different state flags and can describe both how the object's state differs from a "normal" state, e.g. it might be unavailable, and also how it behaves, e.g. it might be selectable.

The `text` property provides textual information about the object. An object usually has a name, but can provide extended information such as a description, help text, or information about any keyboard accelerators it provides. Some objects allow changing the `text` property through the `setText` function, but this information is in most cases read-only.

The `rect` property provides information about the geometry of an accessible object. This information is usually only available for visual objects.

### Actions and Selection

To enable the user to interact with an accessible object the object must expose information about the actions that it can perform. `userActionCount` returns the number of actions supported by an accessible object, and `actionText` returns textual information about those actions. `doAction` invokes an action.

Objects that support selections can define actions to change the selection.

#### Objects and children

A `QAccessibleInterface` provides information about the accessible object, and can also provide information for the children of that object if those children don't provide a `QAccessibleInterface` implementation themselves. This is practical if the object has many similar children (e.g. items in a list view), or if the children are an integral part of the object itself, for example, the different sections in a scroll bar.

If an accessible object provides information about its children through one `QAccessibleInterface`, the children are referenced using indexes. The index is 1-based for the children, i.e. 0 refers to the object itself, 1 to the first child, 2 to the second child, and so on.

All functions in `QAccessibleInterface` that take a child index relate to the object itself if the index is 0, or to the child specified. If a child provides its own interface implementation (which can be retrieved through navigation) asking the parent for information about that child will usually not succeed.

See also `QAccessible`.