Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt\QML Unit Converter (Metric\Imperial)
Forum Update on Monday, May 27th 2025

Qt\QML Unit Converter (Metric\Imperial)

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
qt5c++ qtcan busconversionsqml types
2 Posts 2 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    simone.malvezzi
    wrote on last edited by
    #1

    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!

    JonBJ 1 Reply Last reply
    0
    • S simone.malvezzi

      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!

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

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

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved