QLightSensor Class

The QLightSensor class is a convenience wrapper around QSensor . 更多...

头: #include <QLightSensor>
qmake: QT += sensors
Since: Qt 5.1
继承: QSensor

特性

公共函数

QLightSensor (QObject * parent = Q_NULLPTR)
virtual ~QLightSensor ()
qreal fieldOfView () const
QLightReading * reading () const
void setFieldOfView (qreal fieldOfView )

信号

void fieldOfViewChanged (qreal fieldOfView )

静态公共成员

const QMetaObject staticMetaObject
const char *const type

额外继承成员

详细描述

The QLightSensor class is a convenience wrapper around QSensor .

唯一行为差异是此类正确设置类型。

此类还特征 reading () 函数返回 QLightReading 而不是 QSensorReading .

有关传感器如何工作的细节,见 QLightReading .

另请参阅 QLightReading .

特性文档编制

fieldOfView : const qreal

This property holds a value indicating the field of view.

This is an angle that represents the field of view of the sensor.

Not all light sensor support retrieving their field of view. For sensors that don't support this property, the value will be 0. Whether the field of view is supported can be checked with QSensor::isFeatureSupported () 和 QSensor::FieldOfView 标志。

访问函数:

qreal fieldOfView () const

通知程序信号:

void fieldOfViewChanged (qreal fieldOfView )

成员函数文档编制

QLightSensor:: QLightSensor ( QObject * parent = Q_NULLPTR)

构造传感器作为子级对于 parent .

[虚拟] QLightSensor:: ~QLightSensor ()

销毁传感器。停止传感器若尚未停止。

QLightReading *QLightSensor:: reading () const

返回用于此传感器的读取类。

另请参阅 QSensor::reading ().

void QLightSensor:: setFieldOfView ( qreal fieldOfView )

Sets the field of view to fieldOfView . This is to be called from the backend.

该函数在 Qt 5.1 引入。

另请参阅 fieldOfView ().