mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +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:
@@ -57,12 +57,6 @@ namespace BlackMisc
|
||||
: m_id(id), m_realname(realname), m_email(email), m_password(password), m_callsign(callsign)
|
||||
{}
|
||||
|
||||
//! \copydoc CValueObject::toQVariant()
|
||||
virtual QVariant toQVariant() const override
|
||||
{
|
||||
return QVariant::fromValue(*this);
|
||||
}
|
||||
|
||||
//! Get full name.
|
||||
QString getRealName() const { return m_realname; }
|
||||
|
||||
@@ -126,6 +120,12 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::getValueHash()
|
||||
virtual uint getValueHash() const 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); }
|
||||
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual BlackMisc::CIcon toIcon() const override { return this->getCallsign().toIcon(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user