mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-18 19:35:33 +08:00
refs #314, new propertyBy methods (nested indexes)
This commit is contained in:
@@ -121,6 +121,53 @@ namespace BlackMisc
|
||||
BlackMisc::deserializeJson(json, CCallsign::jsonMembers(), TupleConverter<CCallsign>::toTuple(*this));
|
||||
}
|
||||
|
||||
/*
|
||||
* Index
|
||||
*/
|
||||
QVariant CCallsign::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toQVariant(); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexCallsignString:
|
||||
return QVariant(this->asString());
|
||||
case IndexCallsignStringAsSet:
|
||||
return QVariant(this->getStringAsSet());
|
||||
case IndexTelephonyDesignator:
|
||||
return QVariant(this->getTelephonyDesignator());
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Index
|
||||
*/
|
||||
void CCallsign::setPropertyByIndex(const QVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->fromQVariant(variant);
|
||||
return;
|
||||
}
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexCallsignString:
|
||||
this->m_callsign = variant.toString();
|
||||
break;
|
||||
case IndexCallsignStringAsSet:
|
||||
this->m_callsignAsSet = variant.toString();
|
||||
break;
|
||||
case IndexTelephonyDesignator:
|
||||
this->m_telephonyDesignator = variant.toString();
|
||||
break;
|
||||
default:
|
||||
return CValueObject::setPropertyByIndex(variant, index);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Members
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user