diff --git a/src/blackmisc/aviation/altitude.cpp b/src/blackmisc/aviation/altitude.cpp index 4250186ca..248dd99c9 100644 --- a/src/blackmisc/aviation/altitude.cpp +++ b/src/blackmisc/aviation/altitude.cpp @@ -118,6 +118,12 @@ namespace BlackMisc } } + int CAltitude::comparePropertyByIndex(const CPropertyIndex &index, const CAltitude &compareValue) const + { + if (index.isMyself()) { return this->compare(compareValue); } + return CLength::comparePropertyByIndex(index, compareValue); + } + bool CAltitude::toFlightLevel() { if (m_datum != MeanSeaLevel && m_datum != FlightLevel) { return false; } diff --git a/src/blackmisc/aviation/altitude.h b/src/blackmisc/aviation/altitude.h index e2f84f961..6dc7ba901 100644 --- a/src/blackmisc/aviation/altitude.h +++ b/src/blackmisc/aviation/altitude.h @@ -45,7 +45,7 @@ namespace BlackMisc public PhysicalQuantities::CLength, public Mixin::MetaType, public Mixin::EqualsByMetaClass, - public Mixin::CompareByMetaClass, + // public Mixin::CompareByMetaClass, public Mixin::HashByMetaClass, public Mixin::DBusByMetaClass, public Mixin::DBusByMetaClass, @@ -88,9 +88,6 @@ namespace BlackMisc TrueAltitude //!< Height of the airplane above Mean Sea Level (MSL) }; - //! \copydoc BlackMisc::Mixin::String::toQString - QString convertToQString(bool i18n = false) const; - //! Default constructor: 0m Altitude MSL CAltitude() : CLength(0, PhysicalQuantities::CLengthUnit::m()), m_datum(MeanSeaLevel) {} @@ -197,6 +194,12 @@ namespace BlackMisc //! \copydoc PhysicalQuantities::CPhysicalQuantity::compare int compare(const CAltitude &otherAltitude) const; + //! \copydoc BlackMisc::Mixin::String::toQString + QString convertToQString(bool i18n = false) const; + + //! \copydoc Mixin::Index::setPropertyByIndex + int comparePropertyByIndex(const CPropertyIndex &index, const CAltitude &compareValue) const; + //! Round to the nearest 100ft, like needed for China and Russia //! \remark https://en.wikipedia.org/wiki/Flight_level CAltitude roundedToNearest100ft(bool roundDown) const;