mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
Removed CEarthAngle::toAngle, because implicit conversion already works.
Applied a different workaround to resolve the hiding of an inherited name in CEarthAngle, same as was done in CAltitude. refs #84
This commit is contained in:
@@ -79,9 +79,9 @@ namespace BlackMisc
|
||||
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());
|
||||
return this->compare(qv.value<LATorLON>());
|
||||
else
|
||||
return this->toAngle().compare(qv.value<CAngle>());
|
||||
return this->compare(qv.value<CAngle>());
|
||||
}
|
||||
|
||||
// see here for the reason of thess forward instantiations
|
||||
|
||||
@@ -175,20 +175,20 @@ namespace BlackMisc
|
||||
return l;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief To angle
|
||||
* \return
|
||||
*/
|
||||
BlackMisc::PhysicalQuantities::CAngle toAngle() const
|
||||
{
|
||||
return BlackMisc::PhysicalQuantities::CAngle(static_cast<BlackMisc::PhysicalQuantities::CAngle>(*this));
|
||||
}
|
||||
|
||||
/*!
|
||||
* Compare
|
||||
*/
|
||||
int compare(const QVariant &qv) const;
|
||||
|
||||
/*!
|
||||
* \todo this is a hack, to avoid hiding inherited names in CPhysicalQuantity
|
||||
* (see Effective C++ item 33) CPhysicalQuantity::compare is the real culprit
|
||||
*/
|
||||
int compare(const CEarthAngle &other) const
|
||||
{
|
||||
return static_cast<const CPhysicalQuantity<BlackMisc::PhysicalQuantities::CAngleUnit, BlackMisc::PhysicalQuantities::CAngle> *>(this)->compare(other);
|
||||
}
|
||||
|
||||
/*!
|
||||
* Register metadata
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user