QPressureReading Class
QPressureReading 类保存压力传感器的读数。更多
Header: | #include <QPressureReading> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS Sensors) target_link_libraries(mytarget PRIVATE Qt6::Sensors) |
qmake: | QT += sensors |
继承: | QSensorReading |
属性
- pressure : const qreal
- temperature : const qreal
公共功能
qreal | pressure() const |
void | setPressure(qreal pressure) |
void | setTemperature(qreal temperature) |
qreal | temperature() const |
属性文档
[read-only]
pressure : const qreal
该属性保存测量的大气压力。
以帕斯卡形式返回。
访问功能:
qreal | pressure() const |
另请参阅 QPressureReading Units 。
[read-only]
temperature : const qreal
该属性用于保存压力传感器的温度。
温度以摄氏度为单位返回。如果支持,该属性将提供压力传感器的模具温度。请注意,该温度可能(通常)与QAmbientTemperatureSensor 报告的温度不同。请使用带有QSensor::PressureSensorTemperature 标志的QSensor::isFeatureSupported() 来确定其可用性。
访问函数:
qreal | temperature() const |
成员函数文档
void QPressureReading::setPressure(qreal pressure)
将压力设置为pressure 。
另请参见 pressure() 。
void QPressureReading::setTemperature(qreal temperature)
将压力传感器的温度设置为temperature 。
另请参阅 temperature() 。
© 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.