mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
refs #356 Extend CVariant to support accessing properties by index of the contained value object.
This commit is contained in:
@@ -197,6 +197,18 @@ namespace BlackMisc
|
||||
//! \copydoc CValueObject::compareImpl
|
||||
virtual int compareImpl(const CValueObject &other) const override;
|
||||
|
||||
//! \copydoc CValueObject::setPropertyByIndex
|
||||
virtual void setPropertyByIndex(const CVariant &variant, const CPropertyIndex &index) override;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndex
|
||||
virtual CVariant propertyByIndex(const BlackMisc::CPropertyIndex &index) const override;
|
||||
|
||||
//! \copydoc CValueObject::propertyByIndexAsString
|
||||
virtual QString propertyByIndexAsString(const CPropertyIndex &index, bool i18n = false) const override;
|
||||
|
||||
//! \copydoc CValueObject::equalsPropertyByIndex
|
||||
virtual bool equalsPropertyByIndex(const CVariant &compareValue, const CPropertyIndex &index) const override;
|
||||
|
||||
private:
|
||||
QVariant m_v;
|
||||
|
||||
@@ -234,6 +246,11 @@ namespace BlackMisc
|
||||
return !(value == variant);
|
||||
}
|
||||
|
||||
namespace Private
|
||||
{
|
||||
//! \private Needed so we can copy forward-declared CVariant.
|
||||
inline void assign(CVariant &a, const CVariant &b) { a = b; }
|
||||
}
|
||||
} // namespace
|
||||
|
||||
Q_DECLARE_METATYPE(BlackMisc::CVariant)
|
||||
|
||||
Reference in New Issue
Block a user