mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-03 07:35:48 +08:00
Replace occurrences of CVariant::toCVariant() with CVariant::from()
This commit is contained in:
@@ -28,7 +28,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CVoiceRoom::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -192,7 +192,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraft::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftIcaoCode::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftIcaoData::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftLights::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftParts::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (ITimestampBased::canHandleIndex(index))
|
||||
{
|
||||
return ITimestampBased::propertyByIndex(index);
|
||||
@@ -45,7 +45,7 @@ namespace BlackMisc
|
||||
case IndexCallsign:
|
||||
return m_correspondingCallsign.propertyByIndex(index.copyFrontRemoved());
|
||||
case IndexEngines:
|
||||
return this->m_engines.toCVariant();
|
||||
return CVariant::fromValue(this->m_engines);
|
||||
case IndexFlapsPercentage:
|
||||
return CVariant::fromValue(this->m_flapsPercentage);
|
||||
case IndexGearDown:
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftSituation::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (ITimestampBased::canHandleIndex(index))
|
||||
{
|
||||
return ITimestampBased::propertyByIndex(index);
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAirlineIcaoCode::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAirport::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -335,7 +335,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAtcStation::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CCallsign::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace BlackMisc
|
||||
template <class AVIO>
|
||||
CVariant CModulator<AVIO>::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*derived()); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CTransponder::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CCoordinateGeodetic::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (ICoordinateGeodetic::canHandleIndex(index))
|
||||
{
|
||||
return ICoordinateGeodetic::propertyByIndex(index);
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CJoystickButton::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -248,7 +248,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CKeyboardKey::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CNameVariantPair::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftMapping::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -70,12 +70,12 @@ namespace BlackMisc
|
||||
|
||||
CVariant CClient::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexCapabilities:
|
||||
return this->m_capabilities.toCVariant();
|
||||
return CVariant::fromValue(this->m_capabilities);
|
||||
case IndexCapabilitiesString:
|
||||
return CVariant(this->getCapabilitiesAsString());
|
||||
case IndexCallsign:
|
||||
@@ -91,7 +91,7 @@ namespace BlackMisc
|
||||
case IndexVoiceCapabilitiesPixmap:
|
||||
return CVariant::from(this->m_voiceCapabilities.toPixmap());
|
||||
case IndexVoiceCapabilitiesIcon:
|
||||
return this->m_voiceCapabilities.toIcon().toCVariant();
|
||||
return CVariant::fromValue(this->m_voiceCapabilities.toIcon());
|
||||
case IndexVoiceCapabilitiesString:
|
||||
return CVariant(this->m_voiceCapabilities.toQString(true));
|
||||
default:
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CServer::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -186,7 +186,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CTextMessage::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
|
||||
@@ -193,7 +193,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CUser::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant COriginator::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); }
|
||||
|
||||
@@ -345,14 +345,14 @@ namespace BlackMisc
|
||||
template <class MU, class PQ>
|
||||
CVariant CPhysicalQuantity<MU, PQ>::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*derived()); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexValue:
|
||||
return CVariant::from(this->m_value);
|
||||
case IndexUnit:
|
||||
return this->m_unit.toCVariant();
|
||||
return CVariant::from(this->m_unit);
|
||||
case IndexValueRounded0DigitsWithUnit:
|
||||
return CVariant::from(this->valueRoundedWithUnit(0));
|
||||
case IndexValueRounded1DigitsWithUnit:
|
||||
|
||||
@@ -49,55 +49,55 @@ namespace BlackMisc
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CAccelerationUnit>(unit))
|
||||
{
|
||||
CAcceleration pq(numberD, CMeasurementUnit::unitFromSymbol<CAccelerationUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CAngleUnit>(unit))
|
||||
{
|
||||
CAngle pq(numberD, CMeasurementUnit::unitFromSymbol<CAngleUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CFrequencyUnit>(unit))
|
||||
{
|
||||
CFrequency pq(numberD, CMeasurementUnit::unitFromSymbol<CFrequencyUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CLengthUnit>(unit))
|
||||
{
|
||||
CLength pq(numberD, CMeasurementUnit::unitFromSymbol<CLengthUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CMassUnit>(unit))
|
||||
{
|
||||
CMass pq(numberD, CMeasurementUnit::unitFromSymbol<CMassUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CPressureUnit>(unit))
|
||||
{
|
||||
CPressure pq(numberD, CMeasurementUnit::unitFromSymbol<CPressureUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CSpeedUnit>(unit))
|
||||
{
|
||||
CSpeed pq(numberD, CMeasurementUnit::unitFromSymbol<CSpeedUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CTimeUnit>(unit))
|
||||
{
|
||||
CTime pq(numberD, CMeasurementUnit::unitFromSymbol<CTimeUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
|
||||
if (CMeasurementUnit::isValidUnitSymbol<CTemperatureUnit>(unit))
|
||||
{
|
||||
CTemperature pq(numberD, CMeasurementUnit::unitFromSymbol<CTemperatureUnit>(unit, false));
|
||||
return pq.toCVariant();
|
||||
return CVariant::from(pq);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace BlackMisc
|
||||
{
|
||||
// QVariant cannot be compared directly
|
||||
CVariant p = variant.propertyByIndex(it.key()); // from value object
|
||||
CVariant v = it.value().toCVariant(); // from map
|
||||
CVariant v = it.value(); // from map
|
||||
if (p != v) return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace BlackMisc
|
||||
bool isEmpty() const { return this->m_values.isEmpty(); }
|
||||
|
||||
//! Value
|
||||
CVariant value(const CPropertyIndex &index) const { return this->m_values.value(index).toCVariant(); }
|
||||
CVariant value(const CPropertyIndex &index) const { return CVariant::from(this->m_values.value(index)); }
|
||||
|
||||
//! Set value
|
||||
void value(const CPropertyIndex &index, const CVariant &value) { this->m_values.value(index, value); }
|
||||
@@ -252,7 +252,7 @@ namespace BlackMisc
|
||||
const auto &map = indexMap.map();
|
||||
for (auto it = map.begin(); it != map.end(); ++it)
|
||||
{
|
||||
const CVariant value = it.value().toCVariant();
|
||||
const CVariant value = it.value();
|
||||
const CPropertyIndex index = it.key();
|
||||
if (skipEqualValues)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CSettingKeyboardHotkey::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftModel::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAirspaceAircraftSnapshot::propertyByIndex(const CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CAircraftCfgEntries::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace BlackMisc
|
||||
bool CRemoteAircraftProviderDummy::updateAircraftModel(const CCallsign &callsign, const CAircraftModel &model, const COriginator &originator)
|
||||
{
|
||||
Q_UNUSED(originator);
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexModel, model.toCVariant());
|
||||
CPropertyIndexVariantMap vm(CSimulatedAircraft::IndexModel, CVariant::from(model));
|
||||
int n = this->m_aircraft.applyIfCallsign(callsign, vm);
|
||||
return n > 0;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace BlackMisc
|
||||
|
||||
CVariant CSimulatedAircraft::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -57,12 +57,12 @@ namespace BlackMisc
|
||||
|
||||
CVariant CSimulatorSetup::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexData:
|
||||
return m_data.toCVariant();
|
||||
return CVariant::from(m_data);
|
||||
default:
|
||||
return CValueObject::propertyByIndex(index);
|
||||
}
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace BlackMisc
|
||||
*/
|
||||
CVariant CStatusMessage::propertyByIndex(const BlackMisc::CPropertyIndex &index) const
|
||||
{
|
||||
if (index.isMyself()) { return this->toCVariant(); }
|
||||
if (index.isMyself()) { return CVariant::from(*this); }
|
||||
if (ITimestampBased::canHandleIndex(index)) { return ITimestampBased::propertyByIndex(index); }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
|
||||
@@ -47,15 +47,15 @@ namespace BlackMisc
|
||||
CAtcStation station;
|
||||
if (byPropertyIndex)
|
||||
{
|
||||
station.setPropertyByIndex(CCallsign(cs).toCVariant(), CAtcStation::IndexCallsign);
|
||||
station.setPropertyByIndex(user.toCVariant(), CAtcStation::IndexController);
|
||||
station.setPropertyByIndex(CFrequency(f, CFrequencyUnit::MHz()).toCVariant(), CAtcStation::IndexFrequency);
|
||||
station.setPropertyByIndex(CLength(50, CLengthUnit::km()).toCVariant(), CAtcStation::IndexRange);
|
||||
station.setPropertyByIndex(geoPos.toCVariant(), CAtcStation::IndexPosition);
|
||||
station.setPropertyByIndex(CVariant::from(CCallsign(cs)), CAtcStation::IndexCallsign);
|
||||
station.setPropertyByIndex(CVariant::from(user), CAtcStation::IndexController);
|
||||
station.setPropertyByIndex(CVariant::from(CFrequency(f, CFrequencyUnit::MHz())), CAtcStation::IndexFrequency);
|
||||
station.setPropertyByIndex(CVariant::from(CLength(50, CLengthUnit::km())), CAtcStation::IndexRange);
|
||||
station.setPropertyByIndex(CVariant::from(geoPos), CAtcStation::IndexPosition);
|
||||
station.setPropertyByIndex(CVariant::from(false), CAtcStation::IndexIsOnline);
|
||||
station.setPropertyByIndex(CVariant::from(dtFrom), CAtcStation::IndexBookedFrom);
|
||||
station.setPropertyByIndex(CVariant::from(dtUntil), CAtcStation::IndexBookedUntil);
|
||||
station.setPropertyByIndex(CLength(index + 1, CLengthUnit::NM()).toCVariant(), CAtcStation::IndexDistanceToOwnAircraft);
|
||||
station.setPropertyByIndex(CVariant::from(CLength(index + 1, CLengthUnit::NM())), CAtcStation::IndexDistanceToOwnAircraft);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace BlackMisc
|
||||
using Mixin::Index<Derived>::apply;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::MetaType::toCVariant
|
||||
using Mixin::MetaType<Derived>::toCVariant;
|
||||
// using Mixin::MetaType<Derived>::toCVariant;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::MetaType::convertFromCVariant
|
||||
using Mixin::MetaType<Derived>::convertFromCVariant;
|
||||
|
||||
@@ -65,12 +65,8 @@ namespace BlackMisc
|
||||
return baseIsA(static_cast<const MetaBaseOfT<Derived> *>(derived()), metaTypeId);
|
||||
}
|
||||
|
||||
//! Method to return CVariant
|
||||
//! \deprecated Use CVariant::to() instead.
|
||||
CVariant toCVariant() const;
|
||||
|
||||
//! Set from CVariant
|
||||
//! \deprecated Use CVariant::from() instead.
|
||||
//! \deprecated Use CVariant::to() instead.
|
||||
void convertFromCVariant(const CVariant &variant);
|
||||
|
||||
//! Return QVariant, used with DBus QVariant lists
|
||||
@@ -112,7 +108,6 @@ namespace BlackMisc
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::registerMetadata; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::getMetaTypeId; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::isA; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::toCVariant; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::toQVariant; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::convertFromCVariant; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::convertFromQVariant;
|
||||
@@ -125,7 +120,6 @@ namespace BlackMisc
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::registerMetadata; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::getMetaTypeId; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::isA; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::toCVariant; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::toQVariant; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::convertFromCVariant; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::convertFromQVariant;
|
||||
@@ -375,11 +369,6 @@ namespace BlackMisc
|
||||
|
||||
namespace Mixin
|
||||
{
|
||||
template <class Derived, class... AdditionalTypes>
|
||||
CVariant MetaType<Derived, AdditionalTypes...>::toCVariant() const
|
||||
{
|
||||
return CVariant(derived()->toQVariant());
|
||||
}
|
||||
template <class Derived, class... AdditionalTypes>
|
||||
void MetaType<Derived, AdditionalTypes...>::convertFromCVariant(const CVariant &variant)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user