QAmbientLightReading Class

QAmbientLightReading 类表示环境光传感器的一个读数。更多

头文件: #include <QAmbientLightReading>
CMake: find_package(Qt6 REQUIRED COMPONENTS Sensors)
target_link_libraries(mytarget PRIVATE Qt6::Sensors)
qmake: QT += sensors
继承: QSensorReading

公共类型

enum LightLevel { Undefined, Dark, Twilight, Light, Bright, Sunny }

属性

公共功能

QAmbientLightReading::LightLevel lightLevel() const
void setLightLevel(QAmbientLightReading::LightLevel lightLevel)

详细说明

QAmbientLightReading 单位

环境光传感器使用QAmbientLightReading::LightLevel 枚举中的预定义值返回环境光强度。

成员类型文档

enum QAmbientLightReading::LightLevel

该枚举表示环境光照度。

常数描述
QAmbientLightReading::Undefined0光照度未知。
QAmbientLightReading::Dark1很暗。
QAmbientLightReading::Twilight2中等暗度。
QAmbientLightReading::Light3很亮(如内部照明)。
QAmbientLightReading::Bright4明亮(例如阴暗处)。
QAmbientLightReading::Sunny5非常明亮(如阳光直射)。

物业文件

[read-only] lightLevel : const LightLevel

该属性包含环境光照度。

该值代表环境光线,来自QAmbientLightReading::LightLevel

访问功能:

QAmbientLightReading::LightLevel lightLevel() const

另请参见 QAmbientLightReading Units

成员函数文档

void QAmbientLightReading::setLightLevel(QAmbientLightReading::LightLevel lightLevel)

将环境光照度设置为lightLevel

另请参阅 lightLevel() 。

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