QAccessiblePlugin Class

QAccessiblePlugin 类为为用户界面元素提供可访问性信息的插件提供了一个抽象基类。更多

头文件: #include <QAccessiblePlugin>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
继承: QObject

公共函数

QAccessiblePlugin(QObject *parent = nullptr)
virtual ~QAccessiblePlugin()
virtual QAccessibleInterface *create(const QString &key, QObject *object) = 0

详细说明

编写无障碍插件的方法是:子类化该基类,重新实现纯虚函数create() 并使用Q_PLUGIN_METADATA() 宏导出该类。

另请参阅 如何创建 Qt 插件

成员函数文档

[explicit] QAccessiblePlugin::QAccessiblePlugin(QObject *parent = nullptr)

用给定的parent 构建一个辅助功能插件。插件加载器会自动调用该插件。

[virtual noexcept] QAccessiblePlugin::~QAccessiblePlugin()

销毁辅助功能插件。

您不必明确调用此功能。当插件不再使用时,Qt 会自动将其销毁。

[pure virtual] QAccessibleInterface *QAccessiblePlugin::create(const QString &key, QObject *object)

为类key 和对象object 创建并返回QAccessibleInterface 实现。键值区分大小写。

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.