本页内容

QAmbientTemperatureReading Class

QAmbientTemperatureReading 类用于存储环境温度的读数。更多内容...

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

属性

公共函数

void setTemperature(qreal temperature)
qreal temperature() const

详细说明

环境(室内)温度是以摄氏度为单位的温度。

属性文档

[read-only] temperature : qreal

该属性存储环境温度

单位为摄氏度。

访问函数:

qreal temperature() const

成员函数文档

void QAmbientTemperatureReading::setTemperature(qreal temperature)

将环境温度设置为temperature 。

另请参阅 temperature()。

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