このページでは

QLightSensor Class

QLightSensor クラスは、QSensor をラップした便利なラッパーです。詳細...

ヘッダー: #include <QLightSensor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
継承元: QSensor

プロパティ

パブリック関数

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

シグナル

void fieldOfViewChanged(qreal fieldOfView)

詳細な説明

動作上の唯一の違いは、このクラスが型を適切に設定する点です。

また、このクラスには、QSensorReading の代わりにQLightReading を返すreading() 関数も備わっています。

センサーの動作の詳細については、QLightReading を参照してください。

「QLightReading」も参照してください 。

プロパティのドキュメント

[read-only] fieldOfView : qreal

このプロパティには、視野角を示す値が格納されます。

これは、センサーの視野角を表す角度です。

すべての光センサーが視野角の取得に対応しているわけではありません。このプロパティに対応していないセンサーの場合、値は 0 になります。視野角がサポートされているかどうかは、QSensor::isFeatureSupported() およびQSensor::FieldOfView フラグを使用して確認できます。

アクセス関数:

qreal fieldOfView() const

通知シグナル:

void fieldOfViewChanged(qreal fieldOfView)

メンバ関数のドキュメント

[explicit] QLightSensor::QLightSensor(QObject *parent = nullptr)

parent の子としてセンサーを構築します。

[virtual noexcept] QLightSensor::~QLightSensor()

センサーを破壊する。センサーがまだ停止していない場合は、停止させる。

QLightReading *QLightSensor::reading() const

このセンサーの読み取りクラスを返します。

QSensor::reading()も参照してください 。

void QLightSensor::setFieldOfView(qreal fieldOfView)

視野角をfieldOfView に設定します。これはバックエンドから呼び出す必要があります。

fieldOfView()も参照してください 。

© 2026 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.