QSensorPluginInterface Class

The QSensorPluginInterface class is the pure virtual interface to sensor plugins. 更多...

头: #include <QSensorPluginInterface>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors

公共函数

virtual void registerSensors () = 0

详细描述

The QSensorPluginInterface class is implemented in sensor plugins to register sensor backends with QSensorManager .

另请参阅 Creating a sensor plugin .

成员函数文档编制

[pure virtual] void QSensorPluginInterface:: registerSensors ()

This function is called when the plugin is loaded. The plugin should register sensor backends by calling QSensorManager::registerBackend (). Any backends that utilise other sensors should be registered in the QSensorPluginInterface::sensorsChanged() method instead.

另请参阅 Creating a sensor plugin .