mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-13 07:35:41 +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:
@@ -12,9 +12,9 @@
|
||||
#ifndef BLACKMISC_CALLSIGN_H
|
||||
#define BLACKMISC_CALLSIGN_H
|
||||
|
||||
#include "valueobject.h"
|
||||
#include "propertyindex.h"
|
||||
#include "icon.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
|
||||
namespace BlackMisc
|
||||
{
|
||||
@@ -46,12 +46,6 @@ namespace BlackMisc
|
||||
: m_callsignAsSet(callsign), m_callsign(CCallsign::unifyCallsign(callsign))
|
||||
{}
|
||||
|
||||
//! \copydoc CValueObject::toQVariant()
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual BlackMisc::CIcon toIcon() const override { return CCallsign::convertToIcon(*this); }
|
||||
|
||||
//! Is empty?
|
||||
bool isEmpty() const { return this->m_callsignAsSet.isEmpty(); }
|
||||
|
||||
@@ -91,6 +85,15 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::fromJson
|
||||
virtual 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); }
|
||||
|
||||
//! \copydoc CValueObject::toIcon()
|
||||
virtual BlackMisc::CIcon toIcon() const override { return CCallsign::convertToIcon(*this); }
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
virtual QVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user