I'm accessing some third-party COM objects that have Currency/Decimal properties. ActiveQt supports the Currency (CY) type of COM, which is simply an int64, using qlonglong. For instance, an amount of $1.23 is saved as 12300. Reading such a currency property in a QAxObject is not a problem -- I simply divide by 10000 to get the real amount. However, setting such a property is a problem since the input is taken "at face value". Floating point numbers are converted to qlonglongs and cents are omitted in the conversion:
Qt Code:
  1. double value1 = 1.23;
  2. qaxobject->setProperty("Amount", value1);
  3. // property("Amount") returns 10000 = $1
  4.  
  5. // Multiplying by 10,000 beforehand therefore doesn't work either
  6. qlonglong value2 = 12300; // trying again for $1.23
  7. qaxobject->setProperty("Amount", value2);
  8. // property("Amount") returns 123000000 = $12300
To copy to clipboard, switch view to plain text mode 
Is this because of the conversion to QVariant? If so, does anybody know a way around setProperty/dynamicCall to set the property in its native type? Or are the third-party components at fault? Thanks a lot.
(Using Qt4.8.2, Visual Studio 2010)