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

@@ -30,23 +30,27 @@ namespace BlackMisc
//! Construct from a base class object.
CSettingKeyboardHotkeyList(const CSequence<CSettingKeyboardHotkey> &baseClass);
//! \copydoc CValueObject::toQVariant
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
//! Contains given hotkey function?
bool containsFunction(const CHotkeyFunction &function) const;
//! Key for given function
BlackMisc::Settings::CSettingKeyboardHotkey keyForFunction(const CHotkeyFunction &function) const;
//! Register metadata
static void registerMetadata();
/*!
* Fill the list with hotkeys
* \param reset true, list will be be reset, otherwise values will not be overridde
*/
void initAsHotkeyList(bool reset = true);
//! \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); }
//! Register metadata
static void registerMetadata();
};
} //namespace