mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Issue #77 All classes propertyindex methods use CPropertyIndexRef and QVariant
This commit is contained in:
@@ -51,32 +51,32 @@ namespace BlackMisc
|
||||
setPressureAtMsl(other.getPressureAtMsl());
|
||||
}
|
||||
|
||||
CVariant CGridPoint::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
QVariant CGridPoint::propertyByIndex(BlackMisc::CPropertyIndexRef index) const
|
||||
{
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (index.isMyself()) { return QVariant::fromValue(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexIdentifier:
|
||||
return CVariant::fromValue(m_identifier);
|
||||
return QVariant::fromValue(m_identifier);
|
||||
case IndexPosition:
|
||||
return CVariant::fromValue(m_position);
|
||||
return QVariant::fromValue(m_position);
|
||||
case IndexCloudLayers:
|
||||
return CVariant::fromValue(m_cloudLayers);
|
||||
return QVariant::fromValue(m_cloudLayers);
|
||||
case IndexTemperatureLayers:
|
||||
return CVariant::fromValue(m_temperatureLayers);
|
||||
return QVariant::fromValue(m_temperatureLayers);
|
||||
case IndexWindLayers:
|
||||
return CVariant::fromValue(m_windLayers);
|
||||
return QVariant::fromValue(m_windLayers);
|
||||
case IndexPressureAtMsl:
|
||||
return CVariant::fromValue(m_pressureAtMsl);
|
||||
return QVariant::fromValue(m_pressureAtMsl);
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
void CGridPoint::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
|
||||
void CGridPoint::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
|
||||
{
|
||||
if (index.isMyself()) { (*this) = variant.to<CGridPoint>(); return; }
|
||||
if (index.isMyself()) { (*this) = variant.value<CGridPoint>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user