#[repr(C)]
pub struct Accessible(_);
Expand description

C++ type: QAccessible

C++ documentation:

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

This class is part of Accessibility for QWidget Applications.

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.

Qt supports Microsoft Active Accessibility (MSAA), macOS Accessibility, and the Unix/X11 AT-SPI standard. Other backends can be supported using QAccessibleBridge.

In the Unix/X11 AT-SPI implementation, applications become accessible when two conditions are met:

  • org.a11y.Status.IsEnabled DBus property is true
  • org.a11y.Status.ScreenReaderEnabled DBus property is true

An alternative to setting the DBus AT-SPI properties is to set the QT_LINUX_ACCESSIBILITY_ALWAYS_ON environment variable.

In addition to QAccessible's static functions, Qt offers one generic interface, QAccessibleInterface, that can be used to wrap all widgets and objects (e.g., QPushButton). This single interface provides all the metadata necessary for the assistive technologies. Qt provides implementations of this interface for its built-in widgets as plugins.

When you develop custom widgets, you can create custom subclasses of QAccessibleInterface and distribute them as plugins (using QAccessiblePlugin) or compile them into the application. Likewise, Qt's predefined accessibility support can be built as plugin (the default) or directly into the Qt library. The main advantage of using plugins is that the accessibility classes are only loaded into memory if they are actually used; they don't slow down the common case where no assistive technology is being used.

Qt also includes two convenience classes, QAccessibleObject and QAccessibleWidget, that inherit from QAccessibleInterface and provide the lowest common denominator of metadata (e.g., widget geometry, window title, basic help text). You can use them as base classes when wrapping your custom QObject or QWidget subclasses.

Implementations§

C++ method: static QAccessibleInterface* QAccessible::accessibleInterface(unsigned int uniqueId)

C++ documentation:

Returns the QAccessibleInterface belonging to the id.

Returns 0 if the id is invalid.

C++ method: static void QAccessible::cleanup()

C++ method: static void QAccessible::deleteAccessibleInterface(unsigned int uniqueId)

C++ documentation:

Removes the interface belonging to this id from the cache and deletes it. The id becomes invalid an may be re-used by the cache.

C++ method: static void (*FN_PTR)(QObject*) QAccessible::installRootObjectHandler(void (*FN_PTR)(QObject*) arg1)

C++ method: static void (*FN_PTR)(QAccessibleEvent*) QAccessible::installUpdateHandler(void (*FN_PTR)(QAccessibleEvent*) arg1)

C++ method: static bool QAccessible::isActive()

C++ documentation:

Returns true if the platform requested accessibility information.

This function will return false until a tool such as a screen reader accessed the accessibility framework. It is still possible to use QAccessible::queryAccessibleInterface() even if accessibility is not active. But there will be no notifications sent to the platform.

It is recommended to use this function to prevent expensive notifications via updateAccessibility() when they are not needed.

C++ method: static QPair<int, int> QAccessible::qAccessibleTextBoundaryHelper(const QTextCursor& cursor, QAccessible::TextBoundaryType boundaryType)

C++ method: static QAccessibleInterface* QAccessible::queryAccessibleInterface(QObject* arg1)

C++ documentation:

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.

All interfaces are managed by an internal cache and should not be deleted.

C++ method: static unsigned int QAccessible::registerAccessibleInterface(QAccessibleInterface* iface)

C++ documentation:

Call this function to ensure that manually created interfaces are properly memory managed.

Must only be called exactly once per interface iface. This is implicitly called when calling queryAccessibleInterface, calling this function is only required when QAccessibleInterfaces are instantiated with the "new" operator. This is not recommended, whenever possible use the default functions and let queryAccessibleInterface() take care of this.

When it is necessary to reimplement the QAccessibleInterface::child() function and returning the child after constructing it, this function needs to be called.

C++ method: static void QAccessible::setActive(bool active)

C++ method: static void QAccessible::setRootObject(QObject* object)

C++ documentation:

Sets the root object of the accessible objects of this application to object. All other accessible objects are reachable using object navigation from the root object.

Normally, it isn't necessary to call this function, because Qt sets the QApplication object as the root object immediately before the event loop is entered in QApplication::exec().

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

See also queryAccessibleInterface().

C++ method: static unsigned int QAccessible::uniqueId(QAccessibleInterface* iface)

C++ documentation:

Returns the unique ID for the QAccessibleInterface iface.

C++ method: static void QAccessible::updateAccessibility(QAccessibleEvent* event)

Warning: no exact match found in C++ documentation.Below is the C++ documentation for static void QAccessible::updateAccessibility(QObject object, int child, Event reason):

Trait Implementations§

Returns deleter function for this type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.