37 QML_VALUE_TYPE(pressure)
49 result.m_pressureInPa = 100.0*pressureInHPa;
62 result.m_pressureInPa = PascalPerInHg*pressureInInHg;
75 result.m_pressureInPa = pressureInPa;
83 [[nodiscard]] Q_INVOKABLE
bool isFinite()
const
85 return std::isfinite(m_pressureInPa);
96 m_pressureInPa += other.m_pressureInPa;
112 [[nodiscard]] Q_INVOKABLE
double toHPa()
const
114 return m_pressureInPa/100.0;
121 [[nodiscard]] Q_INVOKABLE
double toInHg()
const
123 return m_pressureInPa/PascalPerInHg;
130 [[nodiscard]] Q_INVOKABLE
double toPa()
const
132 return m_pressureInPa;
136 static constexpr double PascalPerInHg = 3386.39;
139 double m_pressureInPa{ NAN };
152auto operator<<(QDataStream &out,
Units::Pressure pressure) -> QDataStream &;
163auto operator>>(QDataStream &in,
Units::Pressure &pressure) -> QDataStream &;
Convenience class for pressure computations.
Q_INVOKABLE double toPa() const
Convert to Pascal.
Q_INVOKABLE Units::Pressure & operator+=(Units::Pressure other)
Add pressure to this pressure.
Q_INVOKABLE double toInHg() const
Convert to Inches of Mercury.
static constexpr auto fromPa(double pressureInPa) -> Pressure
Constructs a pressure.
Q_INVOKABLE std::partial_ordering operator<=>(const Units::Pressure &rhs) const =default
Comparison.
static constexpr auto fromInHg(double pressureInInHg) -> Pressure
Constructs a pressure.
static constexpr auto fromHPa(double pressureInHPa) -> Pressure
Constructs a pressure.
Q_INVOKABLE double toHPa() const
Convert to Hectopascal.
Q_INVOKABLE bool isFinite() const
Checks if the pressure is valid.
Conversion between units used in aviation.