本页内容

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 : LightLevel

该属性存储环境光强度。

该值代表环境光强度,数据源自QAmbientLightReading::LightLevel 。

访问函数:

QAmbientLightReading::LightLevel lightLevel() const

另请参阅 QAmbientLightReading Units 。

成员函数文档

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

将环境光强度设置为lightLevel 。

另请参阅 lightLevel()。

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