Issue #77 All classes propertyindex methods use CPropertyIndexRef and QVariant

This commit is contained in:
Mat Sutcliffe
2020-11-01 20:05:34 +00:00
parent d9e3d1dccc
commit 0971c8ce68
190 changed files with 1298 additions and 1293 deletions

View File

@@ -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);
}

View File

@@ -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;