QHumidityReading Class

QHumidityReading 类保存湿度传感器的读数。更多

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

属性

公共功能

qreal absoluteHumidity() const
qreal relativeHumidity() const
void setAbsoluteHumidity(qreal value)
void setRelativeHumidity(qreal humidity)

详细说明

QHumidityReading 单位

湿度传感器以百分比形式返回相对湿度,以克/立方米(g/m3)为单位返回绝对湿度。请注意,某些传感器可能不支持绝对湿度,在这种情况下将返回 0。

属性文档

[read-only] absoluteHumidity : const qreal

绝对湿度 以克/立方米为单位测量。请注意,某些传感器可能不支持绝对湿度。

访问功能:

qreal absoluteHumidity() const

另请参阅 QHumidityReading Units

[read-only] relativeHumidity : const qreal

相对湿度 以百分比形式返回。

访问功能:

qreal relativeHumidity() const

另请参阅 QHumidityReading Units

成员函数文档

void QHumidityReading::setAbsoluteHumidity(qreal value)

absoluteHumidity 设置为value

另请参见 absoluteHumidity() 。

void QHumidityReading::setRelativeHumidity(qreal humidity)

relativeHumidity 设置为humidity

另请参见 relativeHumidity() 。

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