mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 23:35:33 +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:
@@ -17,6 +17,7 @@
|
||||
#include "blackmisc/propertyindex.h"
|
||||
#include "blackmisc/mathematics.h"
|
||||
#include "blackmisc/pqstring.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include <QtDBus/QDBusMetaType>
|
||||
#include <QtGlobal>
|
||||
#include <QString>
|
||||
@@ -205,6 +206,12 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::getValueHash
|
||||
virtual uint getValueHash() const override;
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this->derived()); }
|
||||
|
||||
//! \copydoc CValueObject::fromQVariant
|
||||
virtual void fromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant<PQ>(derived(), variant); }
|
||||
|
||||
//! \copydoc CValueObject::toJson
|
||||
virtual QJsonObject toJson() const override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user