mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-16 18:35:35 +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 "propertyindex.h"
|
||||
#include "hwkeyboardkey.h"
|
||||
#include "hotkeyfunction.h"
|
||||
#include "blackmiscfreefunctions.h"
|
||||
#include <QStringList>
|
||||
#include <QKeySequence>
|
||||
|
||||
@@ -55,14 +56,7 @@ namespace BlackMisc
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::fromQVariant
|
||||
virtual void fromQVariant(const QVariant &variant) override
|
||||
{
|
||||
Q_ASSERT(variant.canConvert<CSettingKeyboardHotkey>());
|
||||
if (variant.canConvert<CSettingKeyboardHotkey>())
|
||||
{
|
||||
(*this) = variant.value<CSettingKeyboardHotkey>();
|
||||
}
|
||||
}
|
||||
virtual void fromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant(this, variant); }
|
||||
|
||||
//! \copydoc CValueObject::getValueHash
|
||||
virtual uint getValueHash() const override;
|
||||
|
||||
Reference in New Issue
Block a user