QmlSensors QML Type
QmlSensors 单例提供模块 API。更多
Import Statement: | import QtSensors |
Since: | QtSensors 5.0 |
方法
- string defaultSensorForType(type)
- list<string> sensorTypes()
- list<string> sensorsForType(type)
详细说明
QmlSensors 单例提供模块 API。
该元素不能直接创建,但其功能可作为 QML 单例访问,如下图所示:
import QtSensors import QtSensors as Sensors ... Component.onCompleted: { var types = Sensors.QmlSensors.sensorTypes(); console.log(types.join(", ")); }
方法文档
string defaultSensorForType(type) |
返回已为type 注册的默认传感器标识符。
有关信息,请参阅QSensor::defaultSensorForType() 。
list<string> sensorTypes() |
返回已注册的传感器类型列表。
有关信息,请参阅QSensor::sensorTypes() 。
list<string> sensorsForType(type) |
返回已为type 注册的传感器标识符列表。
有关信息,请参阅QSensor::sensorsForType()。
© 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.