Accessibility in computer software is making applications usable for people with different abilities. It is important to take different people's needs into account, for example, in case of low vision, hearing, dexterity, or cognitive problems. Some examples of accessibility measures are keyboard shortcuts, a high-contrast user interface that uses specially selected colors and fonts, or support for assistive tools such as screen readers and braille displays.
任何应用程序都应瞄准的基本清单:
This part of the documentation assumes that the basics for accessibility, which go hand in hand with usability, are already in good shape. The rest of this document focuses more specifically on supporting assistive technology.
Assistive Tools (or ATs) come in great variety and help users with different tasks. For this reason what individual applications offer (with the help of Qt) is a generic API that allows to inspect what is on screen in a semantic way and offers the typical interactions with the UI elements.
Applications do not usually communicate directly with the assistive tools, but through a platform specific API. Generally the communication with the ATs works though an IPC mechanism. Semantic information about user interface elements, such as buttons and scroll bars, is exposed to the assistive technologies. Qt supports UI Automation on Windows, macOS Accessibility on macOS, and AT-SPI via DBus on Unix/X11. The platform specific technologies are abstracted by Qt, so that applications do not need any platform specific changes to work with the different native APIs. Qt tries to make adding accessibility support to your application as easy as possible, only a few changes from your side may be required to allow even more users to enjoy it.
The main reason to consult this documentation is to learn how to make custom QWidget subclasses and QQuickItem s accessible.
In this overview document, we will examine the overall Qt accessibility architecture, and how to implement accessibility for custom widgets and elements.
这 2 页面聚焦于给出如何取得良好可达性的概述:
这些类为可访问应用程序提供支持:
启用 QML 项的可访问性 | |
与可访问性相关的枚举和静态函数 | |
Implements support for invocable actions in the interface | |
实现对具有可编辑文本的对象的支持 | |
用于可访问性通知的基类 | |
定义暴露有关可访问对象的信息的接口 | |
为 QObjects 实现 QAccessibleInterface 部分 | |
为用户界面元素提供可访问性信息的插件的抽象基类 | |
通知可访问性框架对象的状态已改变 | |
实现对 IAccessibleTable2 单元格接口的支持 | |
Implements support for the IAccessibleTable2 interface | |
表示表格、列表或树中添加或移除单元格的变化。若改变影响多行,firstColumn 和 lastColumn 将返回 -1。同样,对于列,行函数可能返回 -1 | |
光标移动的通知 | |
正在插入文本的通知 | |
实现对文本处理的支持 | |
正被删除文本的通知 | |
对象文本选定改变的信号 | |
有关文本改变的通知。这用于支持可编辑文本 (譬如:行编辑) 的可访问。例如,此事件发生,当选中文本的一部分被粘贴新文本或在编辑器覆盖模式下被替换时。 | |
描述可访问对象的值改变 | |
实现对操纵值对象的支持 | |
为 QWidgets 实现 QAccessibleInterface |