Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions |

# QAccessible Class Reference

The QAccessible class provides enums and static functions relating to accessibility. More...

    #include <QAccessible>

Inherited by QAccessibleInterface and QAccessiblePlugin.

- List of all members, including inherited members

### Public Types

- enum Action { DefaultAction, Press, FirstStandardAction, SetFocus, Increase, ..., LastStandardAction }
- enum Event { AcceleratorChanged, Alert, ContextHelpEnd, ContextHelpStart, DefaultActionChanged, ..., ValueChanged }
- typedef InterfaceFactory
- typedef Relation
- enum RelationFlag { Unrelated, Self, Ancestor, Child, Descendent, ..., Controlled }
- enum Role { AlertMessage, Animation, Application, Assistant, Border, ..., Window }
- typedef RootObjectHandler
- typedef State
- enum StateFlag { Animated, Busy, Checked, Collapsed, DefaultButton, ..., Unavailable }
- enum Text { Name, Description, Value, Help, Accelerator, UserText }
- typedef UpdateHandler

### Static Public Members

- void installFactory ( InterfaceFactory factory )
- RootObjectHandler installRootObjectHandler ( RootObjectHandler handler )
- UpdateHandler installUpdateHandler ( UpdateHandler handler )
- bool isActive ()
- QAccessibleInterface * queryAccessibleInterface ( QObject * object )
- void removeFactory ( InterfaceFactory factory )
- void setRootObject ( QObject * object )
- void updateAccessibility ( QObject * object, int child, Event reason )

## Detailed Description

The QAccessible class provides enums and static functions relating to accessibility.

Accessible applications can be used by people who are not able to use applications by conventional means.

The functions in this class are used for communication between accessible applications (also called AT Servers) and accessibility tools (AT Clients), such as screen readers and braille displays. Clients and servers communicate in the following way:

- AT Servers notify the clients about events through calls to the updateAccessibility() function.
- AT Clients request information about the objects in the server. The QAccessibleInterface class is the core interface, and encapsulates this information in a pure virtual API. Implementations of the interface are provided by Qt through the queryAccessibleInterface() API.

The communication between servers and clients is initialized by the setRootObject() function.

Function pointers can be installed to replace or extend the default behavior of the static functions in QAccessible.

## Member Type Documentation

### enum QAccessible::Action

This enum describes the possible types of action that can occur.

`QAccessible::DefaultAction` |
`QAccessible::Press` |
`QAccessible::FirstStandardAction` |
`QAccessible::SetFocus` |
`QAccessible::Increase` |
`QAccessible::Decrease` |
`QAccessible::Accept` |
`QAccessible::Cancel` |
`QAccessible::Select` |
`QAccessible::ClearSelection` |
`QAccessible::RemoveSelection` |
`QAccessible::ExtendSelection` |
`QAccessible::AddToSelection` |
`QAccessible::LastStandardAction` |

### enum QAccessible::Event

This enum type defines accessible event types.

`QAccessible::AcceleratorChanged` |
`QAccessible::Alert` |
`QAccessible::ContextHelpEnd` |
`QAccessible::ContextHelpStart` |
`QAccessible::DefaultActionChanged` |
`QAccessible::DescriptionChanged` |
`QAccessible::DialogEnd` |
`QAccessible::DialogStart` |
`QAccessible::DragDropEnd` |
`QAccessible::DragDropStart` |
`QAccessible::Focus` |
`QAccessible::ForegroundChanged` |
`QAccessible::HelpChanged` |
`QAccessible::LocationChanged` |
`QAccessible::MenuCommand` |
`QAccessible::MenuEnd` |
`QAccessible::MenuStart` |
`QAccessible::NameChanged` |
`QAccessible::ObjectCreated` |
`QAccessible::ObjectDestroyed` |
`QAccessible::ObjectHide` |
`QAccessible::ObjectReorder` |
`QAccessible::ObjectShow` |
`QAccessible::ParentChanged` |
`QAccessible::PopupMenuEnd` |
`QAccessible::PopupMenuStart` |
`QAccessible::ScrollingEnd` |
`QAccessible::ScrollingStart` |
`QAccessible::Selection` |
`QAccessible::SelectionAdd` |
`QAccessible::SelectionRemove` |
`QAccessible::SelectionWithin` |
`QAccessible::SoundPlayed` |
`QAccessible::StateChanged` |
`QAccessible::ValueChanged` |

### typedef QAccessible::InterfaceFactory

A function pointer type. Use a function with this prototype to install interface factories with installFactory().

The function receives a QObject pointer. If the QObject provides a QAccessibleInterface, it sets the second parameter to point to the corresponding QAccessibleInterface, and returns true; otherwise returns false.

Installed factories are called by queryAccessibilityInterface() until one provides an interface.

### enum QAccessible::RelationFlag
typedef QAccessible::Relation

This enum type defines bit flags that can be combined to indicate the relationship between two accessible objects.

`QAccessible::Unrelated` | The objects are unrelated.
`QAccessible::Self` | The objects are the same.
`QAccessible::Ancestor` | The first object is a parent of the second object.
`QAccessible::Child` | The first object is a direct child of the second object.
`QAccessible::Descendent` | The first object is an indirect child of the second object.
`QAccessible::Sibling` | The objects are siblings.
`QAccessible::Up` | The first object is above the second object.
`QAccessible::Down` | The first object is below the second object.
`QAccessible::Left` | The first object is left of the second object.
`QAccessible::Right` | The first object is right of the second object.
`QAccessible::Covers` | The first object covers the second object.
`QAccessible::Covered` | The first object is covered by the second object.
`QAccessible::FocusChild` | The first object is the second object's focus child.
`QAccessible::Label` | The first object is the label of the second object.
`QAccessible::Labelled` | The first object is labelled by the second object.
`QAccessible::Controller` | The first object controls the second object.
`QAccessible::Controlled` | The first object is controlled by the second object.

Implementations of relationTo() return a combination of these flags. Some values are mutually exclusive.

Implementations of navigate() can accept only one distinct value.

The Relation typedef can store a combination of RelationFlag values.

### enum QAccessible::Role

This enum defines the role of an accessible object. The roles are:

`QAccessible::AlertMessage` | An object that is used to alert the user.
`QAccessible::Animation` | An object that displays an animation.
`QAccessible::Application` | The application's main window.
`QAccessible::Assistant` | An object that provids interactive help.
`QAccessible::Border` | An object that represents a border.
`QAccessible::ButtonDropDown` | A button that drops down a list of items.
`QAccessible::ButtonDropGrid` | A button that drops down a grid.
`QAccessible::ButtonMenu` | A button that drops down a menu.
`QAccessible::Canvas` | An object that displays graphics that the user can interact with.
`QAccessible::Caret` | An object that represents the system caret (text cursor).
`QAccessible::Cell` | A cell in a table.
`QAccessible::Chart` | An object that displays a graphical representation of data.
`QAccessible::CheckBox` | An object that represents an option that can be checked or unchecked. Some options provide a "mixed" state, e.g. neither checked nor unchecked.
`QAccessible::Client` | The client area in a window.
`QAccessible::Clock` | A clock displaying time.
`QAccessible::Column` | A column of cells, usually within a table.
`QAccessible::ColumnHeader` | A header for a column of data.
`QAccessible::ComboBox` | A list of choices that the user can select from.
`QAccessible::Cursor` | An object that represents the mouse cursor.
`QAccessible::Dial` | An object that represents a dial or knob.
`QAccessible::Dialog` | A dialog box.
`QAccessible::Document` | A document window, usually in an MDI environment.
`QAccessible::EditableText` | Editable text
`QAccessible::Equation` | An object that represents a mathematical equation.
`QAccessible::Graphic` | A graphic or picture, e.g. an icon.
`QAccessible::Grip` | A grip that the user can drag to change the size of widgets.
`QAccessible::Grouping` | An object that represents a logical grouping of other objects.
`QAccessible::HelpBalloon` | An object that displays help in a separate, short lived window.
`QAccessible::HotkeyField` | A hotkey field that allows the user to enter a key sequence.
`QAccessible::Indicator` | An indicator that represents a current value or item.
`QAccessible::LayeredPane` | An object that can contain layered children, e.g. in a stack.
`QAccessible::Link` | A link to something else.
`QAccessible::List` | A list of items, from which the user to select one or more items.
`QAccessible::ListItem` | An item in a list of items.
`QAccessible::MenuBar` | A menu bar from which menus are opened by the user.
`QAccessible::MenuItem` | An item in a menu or menu bar.
`QAccessible::NoRole` | The object has no role. This usually indicates an invalid object.
`QAccessible::PageTab` | A page tab that the user can select to switch to a different page in a dialog.
`QAccessible::PageTabList` | A list of page tabs.
`QAccessible::Pane` | A generic container.
`QAccessible::PopupMenu` | A menu which lists options that the user can select to perform an action.
`QAccessible::ProgressBar` | The object displays the progress of an operation in progress.
`QAccessible::PropertyPage` | A property page where the user can change options and settings.
`QAccessible::PushButton` | A button.
`QAccessible::RadioButton` | An object that represents an option that is mutually exclusive with other options.
`QAccessible::Row` | A row of cells, usually within a table.
`QAccessible::RowHeader` | A header for a row of data.
`QAccessible::ScrollBar` | A scroll bar, which allows the user to scroll the visible area.
`QAccessible::Separator` | A separator that divides space into logical areas.
`QAccessible::Slider` | A slider that allows the user to select a value within a given range.
`QAccessible::Sound` | An object that represents a sound.
`QAccessible::SpinBox` | A spin box widget that allows the user to enter a value within a given range.
`QAccessible::Splitter` | A splitter distributing available space between its child widgets.
`QAccessible::StaticText` | Static text, such as labels for other widgets.
`QAccessible::StatusBar` | A status bar.
`QAccessible::Table` | A table representing data in a grid of rows and columns.
`QAccessible::TitleBar` | The title bar caption of a window.
`QAccessible::ToolBar` | A tool bar, which groups widgets that the user accesses frequently.
`QAccessible::ToolTip` | A tool tip which provides information about other objects.
`QAccessible::Tree` | A list of items in a tree structure.
`QAccessible::TreeItem` | An item in a tree structure.
`QAccessible::UserRole` | The first value to be used for user defined roles.
`QAccessible::Whitespace` | Blank space between other objects.
`QAccessible::Window` | A top level window.

### typedef QAccessible::RootObjectHandler

A function pointer type. Use a function with this prototype to install your own root object handler.

The function is called by setRootObject().

### enum QAccessible::StateFlag
typedef QAccessible::State

This enum type defines bit flags that can be combined to indicate the state of an accessible object. The values are:

`QAccessible::Animated` | The object's appearance changes frequently.
`QAccessible::Busy` | The object cannot accept input at the moment.
`QAccessible::Checked` | The object's check box is checked.
`QAccessible::Collapsed` | The object is collapsed, e.g. a closed listview item, or an iconified window.
`QAccessible::DefaultButton` | The object represents the default button in a dialog.
`QAccessible::Expanded` | The object is expandable, and currently the children are visible.
`QAccessible::ExtSelectable` | The object supports extended selection.
`QAccessible::Focusable` | The object can receive focus. Only objects in the active window can receive focus.
`QAccessible::Focused` | The object has keyboard focus.
`QAccessible::HasPopup` | The object opens a popup.
`QAccessible::HotTracked` | The object's appearance is sensitive to the mouse cursor position.
`QAccessible::Invisible` | The object is not visible to the user.
`QAccessible::Linked` | The object is linked to another object, e.g. a hyperlink.
`QAccessible::Marqueed` | The object displays scrolling contents, e.g. a log view.
`QAccessible::Mixed` | The state of the object is not determined, e.g. a tri-state check box that is neither checked nor unchecked.
`QAccessible::Modal` | The object blocks input from other objects.
`QAccessible::Movable` | The object can be moved.
`QAccessible::MultiSelectable` | The object supports multiple selected items.
`QAccessible::Normal` | The normal state.
`QAccessible::Offscreen` | The object is clipped by the visible area. Objects that are off screen are also invisible.
`QAccessible::Pressed` | The object is pressed.
`QAccessible::Protected` | The object is password protected, e.g. a line edit for entering a Password.
`QAccessible::ReadOnly` | The object can usually be edited, but is explicitly set to read-only.
`QAccessible::Selectable` | The object is selectable.
`QAccessible::Selected` | The object is selected.
`QAccessible::SelfVoicing` | The object describes itself through speech or sound.
`QAccessible::Sizeable` | The object can be resized, e.g. top-level windows.
`QAccessible::Traversed` | The object is linked and has been visited.
`QAccessible::Unavailable` | The object is unavailable to the user, e.g. a disabled widget.

Implementations of QAccessibleInterface::state() return a combination of these flags.

The State typedef can store a combination of StateFlag values.

### enum QAccessible::Text

This enum specifies string information that an accessible object returns.

`QAccessible::Name` | The name of the object.
`QAccessible::Description` | A short text describing the object.
`QAccessible::Value` | The value of the object.
`QAccessible::Help` | A longer text giving information about how to use the object.
`QAccessible::Accelerator` | The keyboard shortcut that executes the object's default action.
`QAccessible::UserText` | The first value to be used for user defined text.

### typedef QAccessible::UpdateHandler

A function pointer type. Use a function with this prototype to install your own update function.

The function is called by updateAccessibility().

## Member Function Documentation

### void QAccessible::installFactory ( InterfaceFactory factory ) `[static]`

Installs the InterfaceFactory factory. The last factory added is the first one used by queryAccessibleInterface().

### RootObjectHandler QAccessible::installRootObjectHandler ( RootObjectHandler handler ) `[static]`

Installs the given handler as the function to be used by setRootObject(), and returns the previously installed handler.

### UpdateHandler QAccessible::installUpdateHandler ( UpdateHandler handler ) `[static]`

Installs the given handler as the function to be used by updateAccessibility(), and returns the previously installed handler.

### bool QAccessible::isActive () `[static]`

Returns true if an accessibility implementation has been requested during the runtime of the application; otherwise returns false.

Use this function to prevent potentially expensive notifications via updateAccessibility().

### QAccessibleInterface * QAccessible::queryAccessibleInterface ( QObject * object ) `[static]`

If a QAccessibleInterface implementation exists for the given object, this function returns a pointer to the implementation; otherwise it returns 0.

The function calls all installed factory functions (from most recently installed to least recently installed) until one is found that provides an interface for the class of object. If no factory can provide an accessibility implementation for the class the function loads installed accessibility plugins, and tests if any of the plugins can provide the implementation.

If no implementation for the object's class is available, the function tries to find an implementation for the object's parent class, using the above strategy.

Warning: The caller must call release() on the returned interface.

### void QAccessible::removeFactory ( InterfaceFactory factory ) `[static]`

Removes factory from the list of installed InterfaceFactories.

### void QAccessible::setRootObject ( QObject * object ) `[static]`

Sets the root accessible object of this application to object. All other accessible objects in the application can be reached by the client using object navigation.

You should never need to call this function. Qt sets the QApplication object as the root object immediately before the event loop is entered in QApplication::exec().

Use installRootObjectHandler() to redirect the function call to a customized handler function.

See also RootObjectHandler and queryAccessibleInterface().

### void QAccessible::updateAccessibility ( QObject * object, int child, Event reason ) `[static]`

Notifies accessibility clients about a change in object's accessibility information.

reason specifies the cause of the change, for example, `ValueChange` when the position of a slider has been changed. child is the (1-based) index of the child element that has changed. When child is 0, the object itself has changed.

Call this function whenever the state of your accessible object or one of it's sub-elements has been changed either programmatically (e.g. by calling QLabel::setText()) or by user interaction.

If there are no accessibility tools listening to this event, the performance penalty for calling this function is small, but if determining the parameters of the call is expensive you can test isActive() to avoid unnecessary computations.