Struct qt_gui::QAccessible

source ·
#[repr(C)]
pub struct QAccessible { /* private fields */ }
Expand description

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

C++ class: 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§

source§

impl QAccessible

source

pub unsafe fn accessible_interface( unique_id: c_uint ) -> Ptr<QAccessibleInterface>

Returns the QAccessibleInterface belonging to the id.

Calls C++ function: static QAccessibleInterface* QAccessible::accessibleInterface(unsigned int uniqueId).

C++ documentation:

Returns the QAccessibleInterface belonging to the id.

Returns 0 if the id is invalid.

source

pub unsafe fn cleanup()

Calls C++ function: static void QAccessible::cleanup().

source

pub unsafe fn copy_from( &self, other: impl CastInto<Ref<QAccessible>> ) -> Ref<QAccessible>

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

Calls C++ function: QAccessible& QAccessible::operator=(const QAccessible& other).

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.

source

pub unsafe fn delete_accessible_interface(unique_id: c_uint)

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.

Calls C++ function: 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.

source

pub unsafe fn install_root_object_handler( arg1: Option<extern "C" fn(_: *mut QObject)> ) -> Option<extern "C" fn(_: *mut QObject)>

Calls C++ function: static void (*FN_PTR)(QObject *) QAccessible::installRootObjectHandler(void (*FN_PTR)(QObject *) arg1).

source

pub unsafe fn install_update_handler( arg1: Option<extern "C" fn(_: *mut QAccessibleEvent)> ) -> Option<extern "C" fn(_: *mut QAccessibleEvent)>

Calls C++ function: static void (*FN_PTR)(QAccessibleEvent *) QAccessible::installUpdateHandler(void (*FN_PTR)(QAccessibleEvent *) arg1).

source

pub unsafe fn is_active() -> bool

Returns true if the platform requested accessibility information.

Calls C++ function: 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.

source

pub unsafe fn new_copy( other: impl CastInto<Ref<QAccessible>> ) -> CppBox<QAccessible>

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

Calls C++ function: [constructor] void QAccessible::QAccessible(const QAccessible& other).

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.

source

pub unsafe fn q_accessible_text_boundary_helper( cursor: impl CastInto<Ref<QTextCursor>>, boundary_type: TextBoundaryType ) -> CppBox<QPairOfIntInt>

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

source

pub unsafe fn query_accessible_interface( arg1: impl CastInto<Ptr<QObject>> ) -> Ptr<QAccessibleInterface>

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

Calls C++ function: 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.

source

pub unsafe fn register_accessible_interface( iface: impl CastInto<Ptr<QAccessibleInterface>> ) -> c_uint

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

Calls C++ function: 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.

source

pub unsafe fn set_active(active: bool)

Calls C++ function: static void QAccessible::setActive(bool active).

source

pub unsafe fn set_root_object(object: impl CastInto<Ptr<QObject>>)

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.

Calls C++ function: 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().

source

pub unsafe fn static_meta_object() -> Ref<QMetaObject>

Returns a reference to the staticMetaObject field.

source

pub unsafe fn unique_id( iface: impl CastInto<Ptr<QAccessibleInterface>> ) -> c_uint

Returns the unique ID for the QAccessibleInterface iface.

Calls C++ function: static unsigned int QAccessible::uniqueId(QAccessibleInterface* iface).

C++ documentation:

Returns the unique ID for the QAccessibleInterface iface.

source

pub unsafe fn update_accessibility(event: impl CastInto<Ptr<QAccessibleEvent>>)

Use QAccessible::updateAccessibility(QAccessibleEvent*) instead.

Calls C++ function: 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§

source§

impl CppDeletable for QAccessible

source§

unsafe fn delete(&self)

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

Calls C++ function: [destructor] void QAccessible::~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.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.