mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:07:20 +08:00
Issue #77 All classes propertyindex methods use CPropertyIndexRef and QVariant
This commit is contained in:
@@ -30,17 +30,17 @@ namespace BlackMisc
|
||||
m_position(latitudeDegrees, longitudeDegrees, 0)
|
||||
{}
|
||||
|
||||
CVariant CNavDataReference::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
QVariant CNavDataReference::propertyByIndex(BlackMisc::CPropertyIndexRef index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (index.isMyself()) { return QVariant::fromValue(*this); }
|
||||
return ICoordinateGeodetic::canHandleIndex(index) ?
|
||||
ICoordinateGeodetic::propertyByIndex(index) :
|
||||
CValueObject::propertyByIndex(index);
|
||||
}
|
||||
|
||||
void CNavDataReference::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
void CNavDataReference::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CNavDataReference>(); return; }
|
||||
if (index.isMyself()) { (*this) = variant.value<CNavDataReference>(); return; }
|
||||
CValueObject::setPropertyByIndex(index, variant);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,10 +61,10 @@ namespace BlackMisc
|
||||
virtual std::array<double, 3> normalVectorDouble() const override { return this->m_position.normalVectorDouble(); }
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::propertyByIndex
|
||||
CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const;
|
||||
QVariant propertyByIndex(BlackMisc::CPropertyIndexRef index) const;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::Index::setPropertyByIndex
|
||||
void setPropertyByIndex(const BlackMisc::CPropertyIndex &index, const CVariant &variant);
|
||||
void setPropertyByIndex(BlackMisc::CPropertyIndexRef index, const QVariant &variant);
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::String::toQString
|
||||
QString convertToQString(bool i18n = false) const;
|
||||
|
||||
Reference in New Issue
Block a user