QAccessibleEvent Class | Qt GUI 5.9

Qt 5.9 | Qt GUI | C++ Classes | QAccessibleEvent

Qt 5.9.9 Reference Documentation

# QAccessibleEvent Class

The QAccessibleEvent class is the base class for accessibility notifications. More...

Header: | #include <QAccessibleEvent>
qmake: | QT += gui
Inherited By: | QAccessibleStateChangeEvent, QAccessibleTableModelChangeEvent, QAccessibleTextCursorEvent, and QAccessibleValueChangeEvent

- List of all members, including inherited members

## Public Functions

| QAccessibleEvent(QObject *object, QAccessible::Event type)
| QAccessibleEvent(QAccessibleInterface *interface, QAccessible::Event type)
virtual | ~QAccessibleEvent()
virtual QAccessibleInterface * | accessibleInterface() const
int | child() const
QObject * | object() const
void | setChild(int child)
QAccessible::Event | type() const

## Detailed Description

The QAccessibleEvent class is the base class for accessibility notifications.

This class is used with QAccessible::updateAccessibility().

The event type is one of the values of QAccessible::Event. There are a number of subclasses that should be used to provide more details about the event.

For example to notify about a focus change when re-implementing QWidget::setFocus, the event could be used as follows:

      void MyWidget::setFocus(Qt::FocusReason reason)
      {
          // handle custom focus setting...
          QAccessibleEvent event(f, QAccessible::Focus);
          QAccessible::updateAccessibility(&event);
      }

To enable in process screen readers, all events must be sent after the change has happened.

## Member Function Documentation

### QAccessibleEvent::QAccessibleEvent(QObject *object, QAccessible::Event type)

Constructs a QAccessibleEvent to notify that object has changed. The event type describes what changed.

### QAccessibleEvent::QAccessibleEvent(QAccessibleInterface *interface, QAccessible::Event type)

Constructs a QAccessibleEvent to notify that interface has changed. The event type describes what changed. Use this function if you already have a QAccessibleInterface or no QObject, otherwise consider the overload taking a QObject parameter as it might be cheaper.

### `[virtual]` QAccessibleEvent::~QAccessibleEvent()

Destroys the event.

### `[virtual]` QAccessibleInterface *QAccessibleEvent::accessibleInterface() const

Returns the QAccessibleInterface associated with the event. The caller of this function takes ownership of the returned interface.

### int QAccessibleEvent::child() const

Returns the child index.

See also setChild().

### QObject *QAccessibleEvent::object() const

Returns the event object.

### void QAccessibleEvent::setChild(int child)

Sets the child index to child.

See also child().

### QAccessible::Event QAccessibleEvent::type() const

Returns the event type.