本页内容

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 ` 实现。键区分大小写。

© 2026 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.