|
QUnitConversion
Tools for unit conversion built on top of Qt5 Framework
|
QUnitConversion is a simple lightweight library providing tools for runtime unit conversion. Originally built for Qt, it now works with any string type — Qt dependency is optional. The library is tested with std::string and QString.
QUnitConversion stores units as strings grouped by "family" (for example length or temperature). Each family has its own base unit, conversion inside a family is performed by converting through base unit providing conversion from any unit to any other unit in a family.
Note that each unit should have a unique name, as long as conversion is unit name-based.
QUnitConversion supports aliases for unit names, see aliases example below.
C++20 or later. Qt is not required unless you want to use QString as the string type.
The recommended way to integrate is via CMake FetchContent
Documentation is available here
QUnitConversion supports aliases for units with possible conversion on the fly, so you km/h, kmph and kmh will be converted to m/s properly.
QUnitConversion is distributed under MIT license
Copyright Dmitriy Linev 2020-2026