mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 00:45:46 +08:00
refs #314, fromQVariant / location of toQVariant
* renamed fromQVariant to convertFromQVariant, the "from" methods imply the object is changed (fromJson, fromString ..) * implemented fromQVariant - changing the object by QVariant * moved toQVariant into PQ template * free function setFromQVariant
This commit is contained in:
@@ -60,8 +60,6 @@ namespace BlackMisc
|
||||
//! Constructor.
|
||||
CClient(const CUser &user) : m_user(user) {}
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! Equal operator ==
|
||||
bool operator ==(const CClient &other) const;
|
||||
@@ -75,12 +73,18 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::toJson
|
||||
virtual QJsonObject toJson() const override;
|
||||
|
||||
//! Callsign used with other client
|
||||
const BlackMisc::Aviation::CCallsign &getCallsign() const { return this->m_user.getCallsign(); }
|
||||
|
||||
//! \copydoc CValueObject::fromJson
|
||||
void fromJson(const QJsonObject &json) override;
|
||||
|
||||
//! \copydoc CValueObject::toQVariant()
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::fromQVariant
|
||||
virtual void fromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant(this, variant); }
|
||||
|
||||
//! Callsign used with other client
|
||||
const BlackMisc::Aviation::CCallsign &getCallsign() const { return this->m_user.getCallsign(); }
|
||||
|
||||
//! Get capabilities
|
||||
CIndexVariantMap getCapabilities() const { return this->m_capabilities; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user