QLightSensor Class

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

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

該類在 Qt 5.1 引入。

特性

公共函數

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

信號

void fieldOfViewChanged (qreal fieldOfView )

詳細描述

唯一行為差異是此類正確設置類型。

此類還特徵 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 ().