mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 14:55:36 +08:00
refs #437, remove convertFromCVariant
This commit is contained in:
@@ -361,8 +361,7 @@ namespace BlackGui
|
||||
|
||||
CVariant CAltitudeFormatter::displayRole(const CVariant &altitude) const
|
||||
{
|
||||
CAltitude alt;
|
||||
alt.convertFromCVariant(altitude);
|
||||
CAltitude alt(altitude.to<CAltitude>());
|
||||
if (m_flightLevel) { alt.toFlightLevel(); }
|
||||
return alt.toQString(this->m_useI18n);
|
||||
}
|
||||
|
||||
@@ -374,8 +374,7 @@ namespace BlackGui
|
||||
template <typename ObjectType, typename ContainerType>
|
||||
int CListModelBase<ObjectType, ContainerType>::performUpdateContainer(const BlackMisc::CVariant &variant, bool sort)
|
||||
{
|
||||
ContainerType c;
|
||||
c.convertFromCVariant(variant);
|
||||
ContainerType c(variant.to<ContainerType>());
|
||||
return this->update(c, sort);
|
||||
}
|
||||
|
||||
|
||||
@@ -376,8 +376,7 @@ namespace BlackGui
|
||||
template <class ModelClass, class ContainerType, class ObjectType>
|
||||
int CViewBase<ModelClass, ContainerType, ObjectType>::performUpdateContainer(const BlackMisc::CVariant &variant, bool sort, bool resize)
|
||||
{
|
||||
ContainerType c;
|
||||
c.convertFromCVariant(variant);
|
||||
ContainerType c(variant.to<ContainerType>());
|
||||
return this->updateContainer(c, sort, resize);
|
||||
}
|
||||
|
||||
|
||||
@@ -49,12 +49,7 @@ namespace BlackMisc
|
||||
|
||||
void CVoiceRoom::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.isMyself()) { (*this) = variant.to<CVoiceRoom>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -225,11 +225,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraft::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraft>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -108,12 +108,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftIcaoCode::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftIcaoCode>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -96,12 +96,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftIcaoData::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftIcaoData>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -75,12 +75,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftLights::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftLights>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -61,11 +61,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftParts::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftParts>(); return; }
|
||||
if (ITimestampBased::canHandleIndex(index))
|
||||
{
|
||||
ITimestampBased::setPropertyByIndex(variant, index);
|
||||
@@ -76,7 +72,7 @@ namespace BlackMisc
|
||||
switch (i)
|
||||
{
|
||||
case IndexEngines:
|
||||
this->m_engines = variant.to<decltype(this->m_engines)>();
|
||||
this->m_engines = variant.to < decltype(this->m_engines) > ();
|
||||
break;
|
||||
case IndexFlapsPercentage:
|
||||
this->m_flapsPercentage = variant.toInt();
|
||||
|
||||
@@ -81,11 +81,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftSituation::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftSituation>(); return; }
|
||||
if (ITimestampBased::canHandleIndex(index))
|
||||
{
|
||||
ITimestampBased::setPropertyByIndex(variant, index);
|
||||
|
||||
@@ -58,12 +58,7 @@ namespace BlackMisc
|
||||
|
||||
void CAirlineIcaoCode::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.isMyself()) { (*this) = variant.to<CAirlineIcaoCode>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -78,11 +78,7 @@ namespace BlackMisc
|
||||
|
||||
void CAirport::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CAirport>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -377,7 +377,7 @@ namespace BlackMisc
|
||||
|
||||
void CAtcStation::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself()) { this->convertFromCVariant(variant); return; }
|
||||
if (index.isMyself()) { (*this) = variant.to<CAtcStation>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -147,11 +147,7 @@ namespace BlackMisc
|
||||
|
||||
void CCallsign::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CCallsign>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -128,11 +128,7 @@ namespace BlackMisc
|
||||
template <class AVIO>
|
||||
void CModulator<AVIO>::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { Q_ASSERT_X(false, Q_FUNC_INFO, "Wrong index to base template"); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -171,11 +171,7 @@ namespace BlackMisc
|
||||
|
||||
void CTransponder::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CTransponder>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -139,11 +139,7 @@ namespace BlackMisc
|
||||
|
||||
void CCoordinateGeodetic::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CCoordinateGeodetic>(); return; }
|
||||
ICoordinateGeodetic::ColumnIndex i = index.frontCasted<ICoordinateGeodetic::ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -32,13 +32,8 @@ namespace BlackMisc
|
||||
|
||||
void CJoystickButton::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CJoystickButton>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case IndexButton:
|
||||
|
||||
@@ -277,11 +277,7 @@ namespace BlackMisc
|
||||
|
||||
void CKeyboardKey::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CKeyboardKey>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -49,11 +49,7 @@ namespace BlackMisc
|
||||
|
||||
void CNameVariantPair::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CNameVariantPair>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
|
||||
// special case, handle icon and allow to set it
|
||||
|
||||
@@ -55,11 +55,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftMapping::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftMapping>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -101,11 +101,7 @@ namespace BlackMisc
|
||||
|
||||
void CClient::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CClient>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -70,12 +70,7 @@ namespace BlackMisc
|
||||
|
||||
void CServer::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.isMyself()) { (*this) = variant.to<CServer>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -207,11 +207,7 @@ namespace BlackMisc
|
||||
|
||||
void CTextMessage::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CTextMessage>(); return; }
|
||||
if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; }
|
||||
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
|
||||
@@ -216,11 +216,7 @@ namespace BlackMisc
|
||||
|
||||
void CUser::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CUser>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
/* Copyright (C) 2013
|
||||
* swift Project Community / Contributors
|
||||
*
|
||||
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
|
||||
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
|
||||
* including this file, may be copied, modified, propagated, or distributed except according to the terms
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \file
|
||||
|
||||
#ifndef BLACKMISC_NOTIFICATIONSOUNDS_H
|
||||
#define BLACKMISC_NOTIFICATIONSOUNDS_H
|
||||
|
||||
@@ -7,7 +18,7 @@ namespace BlackSound
|
||||
/*!
|
||||
* Simplified enums to play sounds.
|
||||
* \remarks Currently located in project BlackMisc (i.e. outside project BlackSound)
|
||||
* as this allows to trigger sounds without using Multimedia libraries.
|
||||
* as this allows to trigger sounds without using Multimedia libraries.
|
||||
*/
|
||||
struct CNotificationSounds
|
||||
{
|
||||
@@ -31,6 +42,6 @@ namespace BlackSound
|
||||
NotificationsLoadSounds //!< end marker and force loading of sounds, keep as last element
|
||||
};
|
||||
};
|
||||
}
|
||||
} // ns
|
||||
|
||||
#endif // guard
|
||||
|
||||
@@ -371,11 +371,7 @@ namespace BlackMisc
|
||||
template <class MU, class PQ>
|
||||
void CPhysicalQuantity<MU, PQ>::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<PQ>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
@@ -383,7 +379,7 @@ namespace BlackMisc
|
||||
this->m_value = variant.toDouble();
|
||||
break;
|
||||
case IndexUnit:
|
||||
this->m_unit.convertFromCVariant(variant);
|
||||
this->m_unit = variant.to<MU>();
|
||||
break;
|
||||
case IndexValueRounded0DigitsWithUnit:
|
||||
case IndexValueRounded1DigitsWithUnit:
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace BlackMisc
|
||||
uint getValueHash() const;
|
||||
|
||||
//! \copydoc CValueObject::qHash
|
||||
friend uint qHash(const PQ &pq) { return pq.getValueHash(); };
|
||||
friend uint qHash(const PQ &pq) { return pq.getValueHash(); }
|
||||
|
||||
//! \copydoc CValueObject::toJson
|
||||
QJsonObject toJson() const;
|
||||
|
||||
@@ -71,11 +71,7 @@ namespace BlackMisc
|
||||
|
||||
void CSettingKeyboardHotkey::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CSettingKeyboardHotkey>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -62,11 +62,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftModel::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftModel>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -107,11 +107,7 @@ namespace BlackMisc
|
||||
|
||||
void CAirspaceAircraftSnapshot::setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CAirspaceAircraftSnapshot>(); return; }
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
}
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@ namespace BlackMisc
|
||||
|
||||
void CAircraftCfgEntries::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself()) { this->convertFromCVariant(variant); return; }
|
||||
if (index.isMyself()) { (*this) = variant.to<CAircraftCfgEntries>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -64,11 +64,7 @@ namespace BlackMisc
|
||||
|
||||
void CSimulatedAircraft::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CSimulatedAircraft>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
@@ -70,17 +70,12 @@ namespace BlackMisc
|
||||
|
||||
void CSimulatorSetup::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
|
||||
if (index.isMyself()) { (*this) = variant.to<CSimulatorSetup>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
case IndexData:
|
||||
this->m_data.convertFromCVariant(variant.value<QString>());
|
||||
this->m_data = variant.to<CNameVariantPairList>();
|
||||
break;
|
||||
default:
|
||||
CValueObject::setPropertyByIndex(variant, index);
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace BlackMisc
|
||||
*/
|
||||
void CStatusMessage::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself()) { this->convertFromCVariant(variant); return; }
|
||||
if (index.isMyself()) { (*this) = variant.to<CStatusMessage>(); return; }
|
||||
if (ITimestampBased::canHandleIndex(index)) { ITimestampBased::setPropertyByIndex(variant, index); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
|
||||
@@ -109,12 +109,6 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::Mixin::Index::apply
|
||||
using Mixin::Index<Derived>::apply;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::MetaType::toCVariant
|
||||
// using Mixin::MetaType<Derived>::toCVariant;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::MetaType::convertFromCVariant
|
||||
using Mixin::MetaType<Derived>::convertFromCVariant;
|
||||
|
||||
//! \copydoc BlackMisc::Mixin::JsonByTuple::toJson
|
||||
using Mixin::JsonByTuple<Derived>::toJson;
|
||||
|
||||
|
||||
@@ -66,10 +66,6 @@ namespace BlackMisc
|
||||
return baseIsA(static_cast<const MetaBaseOfT<Derived> *>(derived()), metaTypeId);
|
||||
}
|
||||
|
||||
//! Set from CVariant
|
||||
//! \deprecated Use CVariant::to() instead.
|
||||
void convertFromCVariant(const CVariant &variant);
|
||||
|
||||
//! Return QVariant, used with DBus QVariant lists
|
||||
//! \deprecated Use QVariant::fromValue() instead.
|
||||
QVariant toQVariant() const
|
||||
@@ -110,7 +106,6 @@ namespace BlackMisc
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::getMetaTypeId; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::isA; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::toQVariant; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::convertFromCVariant; \
|
||||
using ::BlackMisc::Mixin::MetaType<DERIVED>::convertFromQVariant;
|
||||
|
||||
/*!
|
||||
@@ -122,7 +117,6 @@ namespace BlackMisc
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::getMetaTypeId; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::isA; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::toQVariant; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::convertFromCVariant; \
|
||||
using ::BlackMisc::Mixin::MetaTypeAndQList<DERIVED>::convertFromQVariant;
|
||||
|
||||
} // Mixin
|
||||
@@ -375,16 +369,6 @@ namespace BlackMisc
|
||||
//! \private Needed so we can copy forward-declared CVariant.
|
||||
inline void assign(CVariant &a, const CVariant &b) { a = b; }
|
||||
}
|
||||
|
||||
namespace Mixin
|
||||
{
|
||||
template <class Derived, class... AdditionalTypes>
|
||||
void MetaType<Derived, AdditionalTypes...>::convertFromCVariant(const CVariant &variant)
|
||||
{
|
||||
derived()->convertFromQVariant(variant.getQVariant());
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::CVariant)
|
||||
|
||||
@@ -46,11 +46,7 @@ namespace BlackMisc
|
||||
*/
|
||||
void CTestValueObject::setPropertyByIndex(const CVariant &variant, const BlackMisc::CPropertyIndex &index)
|
||||
{
|
||||
if (index.isMyself())
|
||||
{
|
||||
this->convertFromCVariant(variant);
|
||||
return;
|
||||
}
|
||||
if (index.isMyself()) { (*this) = variant.to<CTestValueObject>(); return; }
|
||||
ColumnIndex i = index.frontCasted<ColumnIndex>();
|
||||
switch (i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user