AmbientLightReading QML Type

AmbientLightReading 元素用于保存AmbientLightSensor 读数。更多

Import Statement: import QtSensors
Since: QtSensors 5.0
Inherits:

SensorReading

属性

详细说明

AmbientLightReading 元素保存了最多的AmbientLightSensor 读数。

该元素封装了QAmbientLightReading 类。详情请参见QAmbientLightReading 文档。

此元素不能直接创建。

属性文档

lightLevel : LightLevel

该属性用于保存环境光照度。

有关此属性的信息,请参阅QAmbientLightReading::lightLevel

请注意,LightLevel 常量是通过AmbientLightReading 类公开的。

AmbientLightSensor {
    onReadingChanged: {
        if (reading.lightLevel == AmbientLightReading.Dark)
            // do something
    }
}

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