Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt\QML Unit Converter (Metric\Imperial)



  • Hi;
    I'm looking for a complete unit converter written for Qt\C++ (Metric\Imperial(US)\Imperial(UK)).
    Doing so with some c++ classes could be a simple task, but I was wondering if there's something already implemented in Qt. I checked documentation and I don't find anything on API supporting these type conversion (Engineering software does use a lot those kind of functions and having this directly in Qt APIs could be really useful).
    I saw that there's something related to Locale QML. But I'm not sure that I can achieve this using javascript and I would prefer something written on c++ for performance purposes.

    Any help would be appreciated. Thanks!



  • @simone-malvezzi
    No, Qt does not supply a set of measurement conversion tables, that's not its job. You could write it yourself, see if there is any pre-written C++ libraries/tables provided, or possibly grab them off the net, either dynamically or statically.

    As an aside, you will have to decide how "complete" you want to be. Personally I am great fan of Imperial instead of this Metric rubbish, but even I don't measure in "rods", "poles" & "perches" (e.g. http://www.northcravenheritage.org.uk/NCHTJto2009/Journals/2006/RodsPolesPerches/RodsPolesPerches.html) ;-) Though --- and I'm sure you're fascinated --- in winter I measure temperature in Centigrade but in summer I measure in Farenheit....