mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-23 07:15:35 +08:00
using hashes to perform comparisons between blackmisc value objects stored inside of QVariant
refs #81
This commit is contained in:
committed by
Mathew Sutcliffe
parent
67a5dbfe48
commit
a280d239e6
@@ -71,6 +71,18 @@ namespace BlackMisc
|
||||
return LATorLON(a);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compare
|
||||
*/
|
||||
template <class LATorLON> int CEarthAngle<LATorLON>::compare(const QVariant &qv) const
|
||||
{
|
||||
Q_ASSERT(qv.canConvert<LATorLON>() || qv.canConvert<CAngle>());
|
||||
Q_ASSERT(qv.isValid() && !qv.isNull());
|
||||
if (qv.canConvert<LATorLON>())
|
||||
return this->toAngle().compare(qv.value<LATorLON>().toAngle());
|
||||
else
|
||||
return this->toAngle().compare(qv.value<CAngle>());
|
||||
}
|
||||
|
||||
// see here for the reason of thess forward instantiations
|
||||
// http://www.parashift.com/c++-faq/separate-template-class-defn-from-decl.html
|
||||
|
||||
Reference in New Issue
Block a user