Fixed hash for PQ, was based on long

(which of course did not work properly)
This commit is contained in:
Klaus Basan
2014-01-20 13:00:39 +01:00
parent e3ba42d152
commit 49b58cf582

View File

@@ -270,8 +270,9 @@ namespace BlackMisc
template <class MU, class PQ> uint CPhysicalQuantity<MU, PQ>::getValueHash() const
{
QList<uint> hashs;
hashs << this->m_unit.getValueHash();
hashs << qHash(static_cast<long>(this->m_value));
// there is no double qHash
// also unit and rounding has to be considered
hashs << qHash(this->valueRoundedWithUnit(MU::defaultUnit()));
return BlackMisc::calculateHash(hashs, "PQ");
}