Sensor QML Type
传感器元素是传感器的基本类型。更多
Import Statement: | import QtSensors |
Since: | QtSensors 5.0 |
Inherited By: |
属性
- active : bool
- alwaysOn : bool
- availableDataRates : list<Range>
- axesOrientationMode : Sensor::AxesOrientationMode
(since QtSensors 5.1)
- bufferSize : int
(since QtSensors 5.1)
- busy : bool
- connectedToBackend : bool
- currentOrientation : int
(since QtSensors 5.1)
- dataRate : int
- description : string
- efficientBufferSize : int
(since QtSensors 5.1)
- error : int
- identifier : string
- maxBufferSize : int
(since QtSensors 5.1)
- outputRange : int
- outputRanges : list<OutputRange>
- reading : SensorReading
- skipDuplicates : bool
(since QtSensors 5.1)
- type : string
- userOrientation : int
(since QtSensors 5.1)
方法
- bool isFeatureSupported(feature)
(since QtSensors 6.7)
- bool start()
- bool stop()
详细说明
传感器元素是传感器的基本类型。
该元素封装了QSensor 类。详情请查看QSensor 文档。
该元素不能直接创建。请使用其中一个子类。
属性文档
active : bool |
该属性包含一个值,用于指示传感器是否处于活动状态。
有关此属性的信息,请参阅QSensor::active 。
alwaysOn : bool |
该属性包含一个值,用于指示传感器是否应在屏幕关闭时保持运行。
有关此属性的信息,请参阅QSensor::alwaysOn 。
availableDataRates : list<Range> |
该属性保存传感器支持的数据速率。
有关此属性的信息,请参阅QSensor::availableDataRates 。
axesOrientationMode : Sensor::AxesOrientationMode |
bufferSize : int |
busy : bool |
该属性保存一个值,用于指示传感器是否繁忙。
有关此属性的信息,请参阅QSensor::busy 。
connectedToBackend : bool |
该属性包含一个值,用于指示传感器是否已连接到后端。
有关此属性的信息,请参阅QSensor::connectedToBackend 。
currentOrientation : int |
dataRate : int |
该属性保存传感器运行时的数据速率。
有关此属性的信息,请参阅QSensor::dataRate 。
description : string |
该属性保存传感器的描述性字符串。
efficientBufferSize : int |
error : int |
该属性保存在传感器上设置的最后一个错误代码。
identifier : string |
该属性保存传感器的后端标识符。
有关此属性的信息,请参阅QSensor::identifier 。
maxBufferSize : int |
outputRange : int |
该属性保存传感器使用的输出范围。
有关此属性的信息,请参阅QSensor::outputRange 。
outputRanges : list<OutputRange> |
该属性保存传感器支持的输出范围列表。
有关此属性的信息,请参阅QSensor::outputRanges 。
reading : SensorReading |
skipDuplicates : bool |
type : string |
该属性表示传感器的类型。
userOrientation : int |
该属性表示在 UserOrientation(用户方向)模式下用于旋转读数值的角度。
有关此属性的信息,请参阅QSensor::userOrientation 。
此属性在 QtSensors 5.1 中引入。
方法文档
|
检查后端是否支持特定功能。如果feature 受支持,则返回true
,否则返回false
。有关功能说明,请参阅QSensor::Feature 。
有关信息,请参阅QSensor::isFeatureSupported 。
此方法在 QtSensors 6.7 中引入。
bool start() |
开始从传感器获取值。如果传感器已启动,则返回 true,否则返回 false。
有关信息,请参阅QSensor::start() 。
bool stop() |
停止从传感器获取值。如果传感器已停止,则返回 true,否则返回 false。
有关信息,请参阅QSensor::stop() 。
© 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.