mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 17:35:34 +08:00
refs #345 First wave of value classes using the CValueObjectStdTuple CRTP class template.
This commit is contained in:
@@ -24,7 +24,7 @@ namespace BlackMisc
|
||||
namespace Settings
|
||||
{
|
||||
//! Value object encapsulating the keyboard hotkey assignment
|
||||
class CSettingKeyboardHotkey : public CValueObject
|
||||
class CSettingKeyboardHotkey : public CValueObjectStdTuple<CSettingKeyboardHotkey>
|
||||
{
|
||||
public:
|
||||
//! Properties by index
|
||||
@@ -51,33 +51,6 @@ namespace BlackMisc
|
||||
//! Constructor
|
||||
CSettingKeyboardHotkey(const Hardware::CKeyboardKey &key, const CHotkeyFunction &function);
|
||||
|
||||
//! \copydoc CValueObject::toQVariant
|
||||
virtual QVariant toQVariant() const override { return QVariant::fromValue(*this); }
|
||||
|
||||
//! \copydoc CValueObject::convertFromQVariant
|
||||
virtual void convertFromQVariant(const QVariant &variant) override { BlackMisc::setFromQVariant(this, variant); }
|
||||
|
||||
//! \copydoc CValueObject::getValueHash
|
||||
virtual uint getValueHash() const override;
|
||||
|
||||
//! \copydoc CValueObject::toJson
|
||||
virtual QJsonObject toJson() const override;
|
||||
|
||||
//! \copydoc CValueObject::convertFromJson
|
||||
virtual void convertFromJson(const QJsonObject &json) override;
|
||||
|
||||
//! Register metadata
|
||||
static void registerMetadata();
|
||||
|
||||
//! Equal?
|
||||
bool operator ==(const CSettingKeyboardHotkey &other) const;
|
||||
|
||||
//! Unequal operator !=
|
||||
bool operator !=(const CSettingKeyboardHotkey &other) const;
|
||||
|
||||
//! <
|
||||
bool operator<(CSettingKeyboardHotkey const &other) const;
|
||||
|
||||
//! Get key code
|
||||
const Hardware::CKeyboardKey &getKey() const { return m_key; }
|
||||
|
||||
@@ -118,21 +91,6 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::convertToQString
|
||||
virtual QString convertToQString(bool i18n = false) const override;
|
||||
|
||||
//! \copydoc CValueObject::getMetaTypeId
|
||||
virtual int getMetaTypeId() const override;
|
||||
|
||||
//! \copydoc CValueObject::isA
|
||||
virtual bool isA(int metaTypeId) const override;
|
||||
|
||||
//! \copydoc CValueObject::compareImpl(otherBase)
|
||||
virtual int compareImpl(const CValueObject &otherBase) const override;
|
||||
|
||||
//! \copydoc CValueObject::marshallToDbus
|
||||
virtual void marshallToDbus(QDBusArgument &argument) const override;
|
||||
|
||||
//! \copydoc CValueObject::unmarshallFromDbus
|
||||
virtual void unmarshallFromDbus(const QDBusArgument &argument) override;
|
||||
|
||||
private:
|
||||
BLACK_ENABLE_TUPLE_CONVERSION(CSettingKeyboardHotkey)
|
||||
Hardware::CKeyboardKey m_key; //!< code similar to Qt::Key
|
||||
|
||||
Reference in New Issue
Block a user