Sensor QML Type

The Sensor element serves as a base type for sensors. 更多...

import 语句: import QtSensors
Since: QtSensors 5.0
继承者: Accelerometer , AmbientLightSensor , AmbientTemperatureSensor , Compass , Gyroscope , HumiditySensor , LightSensor , Magnetometer , OrientationSensor , PressureSensor , ProximitySensor , RotationSensor ,和 TiltSensor

特性

方法

详细描述

The Sensor element serves as a base type for sensors.

此元素包裹 QSensor 类。请参阅文档编制 QSensor 了解细节。

This element cannot be directly created. Please use one of the sub-classes instead.

特性文档编制

active : bool

This property holds a value to indicate if the sensor is active.

Please see QSensor::active for information about this property.

alwaysOn : bool

This property holds a value to indicate if the sensor should remain running when the screen is off.

Please see QSensor::alwaysOn for information about this property.

availableDataRates : list < Range >

This property holds the data rates that the sensor supports.

Please see QSensor::availableDataRates for information about this property.

[since QtSensors 5.1] axesOrientationMode : Sensor::AxesOrientationMode

This property holds the mode that affects how the screen orientation changes reading values.

Please see QSensor::axesOrientationMode for information about this property.

This property was introduced in QtSensors 5.1.

[since QtSensors 5.1] bufferSize : int

This property holds the size of the buffer.

Please see QSensor::bufferSize for information about this property.

This property was introduced in QtSensors 5.1.

busy : bool

This property holds a value to indicate if the sensor is busy.

Please see QSensor::busy for information about this property.

connectedToBackend : bool

This property holds a value indicating if the sensor has connected to a backend.

Please see QSensor::connectedToBackend for information about this property.

[since QtSensors 5.1] currentOrientation : int

This property holds the current orientation that is used for rotating the reading values.

Please see QSensor::currentOrientation for information about this property.

This property was introduced in QtSensors 5.1.

dataRate : int

This property holds the data rate that the sensor should be run at.

Please see QSensor::dataRate for information about this property.

description : string

此特性保持用于传感器的描述性字符串。

[since QtSensors 5.1] efficientBufferSize : int

The property holds the most efficient buffer size.

Please see QSensor::efficientBufferSize for information about this property.

This property was introduced in QtSensors 5.1.

error : int

此特性保持传感器设置的最后错误代码。

标识符 : string

This property holds the backend identifier for the sensor.

Please see QSensor::identifier for information about this property.

[since QtSensors 5.1] maxBufferSize : int

This property holds the maximum buffer size.

Please see QSensor::maxBufferSize for information about this property.

This property was introduced in QtSensors 5.1.

outputRange : int

This property holds the output range in use by the sensor.

Please see QSensor::outputRange for information about this property.

outputRanges : list < OutputRange >

This property holds a list of output ranges the sensor supports.

Please see QSensor::outputRanges for information about this property.

reading : SensorReading

This property holds the reading class.

Please see QSensor::reading for information about this property.

另请参阅 QML Reading types .

[since QtSensors 5.1] skipDuplicates : bool

This property indicates whether duplicate reading values should be omitted.

Please see QSensor::skipDuplicates for information about this property.

This property was introduced in QtSensors 5.1.

type : string

此特性保持传感器的类型。

[since QtSensors 5.1] userOrientation : int

This property holds the angle used for rotating the reading values in the UserOrientation mode.

Please see QSensor::userOrientation for information about this property.

This property was introduced in QtSensors 5.1.


方法文档编制

bool start ()

Start retrieving values from the sensor. Returns true if the sensor was started, false otherwise.

Please see QSensor::start() for information.

bool stop ()

Stop retrieving values from the sensor. Returns true if the sensor was stopped, false otherwise.

Please see QSensor::stop() for information.