QSensorPluginInterface Class
QSensorPluginInterface 类是传感器插件的纯虚拟接口。更多内容...
| 头文件: | #include <QSensorPluginInterface> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) |
| qmake: | QT += sensors |
公共函数
| virtual void | registerSensors() = 0 |
详细说明
QSensorPluginInterface 类在传感器插件中实现,用于向 `QSensorManager` 注册传感器后端。
另请参阅 “创建传感器插件”。
成员函数文档
[pure virtual] void QSensorPluginInterface::registerSensors()
该函数在插件加载时被调用。插件应通过调用 `QSensorManager::registerBackend()` 来注册传感器后端。任何使用其他传感器的后端,应改在 `QSensorPluginInterface::sensorsChanged()` 方法中进行注册。
另请参阅 “创建传感器插件”。
© 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.