What is the best practice to add the possibility for users to choose the preferred units of measurement in an application written in Qt/QML and C++?
My case is a front-end application that shows data coming from a PLC, giving also the possibility to edit some of them. The PLC data is in millimeters, grams, degrees Celsius, and meters per minute and need to remain in these units.
I want to add the possibility in the front-end application to choose if you want to show the data in millimeters or feet, Celsius or Fahrenheit, etc...
I was thinking about a singleton QObject derived class that returns as Q_PROPERTY the units of measurement ("mm", "oz", etc...), but I'm not sure about developing some slots that convert the values because I can not dynamically update the interface when the user switch the unit of measurement.
P.S. I would like to avoid using boost libraries