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:
Klaus Basan
2014-08-19 01:55:15 +02:00
parent c21a0bb0e4
commit 290abe3693
84 changed files with 478 additions and 388 deletions

View File

@@ -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;