mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +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:
@@ -15,6 +15,7 @@
|
||||
#include "valueobject.h"
|
||||
#include "range.h"
|
||||
#include "indexvariantmap.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
#include "predicates.h"
|
||||
#include "json.h"
|
||||
#include <algorithm>
|
||||
@@ -93,6 +94,9 @@ namespace BlackMisc
|
||||
//! \copydoc BlackMisc::CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(derived()); }
|
||||
|
||||
//! \copydoc CValueObject::fromQVariant
|
||||
virtual void fromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant< C<T> >(&derived(), variant); }
|
||||
|
||||
//! \copydoc BlackMisc::CValueObject::getValueHash
|
||||
virtual uint getValueHash() const override { return qHash(&derived()); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user