Issue #77 All classes propertyindex methods use CPropertyIndexRef and QVariant

This commit is contained in:
Mat Sutcliffe
2020-11-01 20:05:34 +00:00
parent d9e3d1dccc
commit 0971c8ce68
190 changed files with 1298 additions and 1293 deletions

View File

@@ -27,23 +27,23 @@ namespace BlackMisc
this->getDbKeyAsStringInParentheses(" ");
}
CVariant CRole::propertyByIndex(const CPropertyIndex &index) const
QVariant CRole::propertyByIndex(CPropertyIndexRef index) const
{
if (index.isMyself()) { return CVariant::from(*this); }
if (index.isMyself()) { return QVariant::fromValue(*this); }
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { return IDatastoreObjectWithIntegerKey::propertyByIndex(index); }
const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)
{
case IndexName: return CVariant::fromValue(m_name);
case IndexDescription: return CVariant::fromValue(m_description);
case IndexName: return QVariant::fromValue(m_name);
case IndexDescription: return QVariant::fromValue(m_description);
default: break;
}
return CValueObject::propertyByIndex(index);
}
void CRole::setPropertyByIndex(const CPropertyIndex &index, const CVariant &variant)
void CRole::setPropertyByIndex(CPropertyIndexRef index, const QVariant &variant)
{
if (index.isMyself()) { (*this) = variant.to<CRole>(); return; }
if (index.isMyself()) { (*this) = variant.value<CRole>(); return; }
if (IDatastoreObjectWithIntegerKey::canHandleIndex(index)) { IDatastoreObjectWithIntegerKey::setPropertyByIndex(index, variant); return; }
const ColumnIndex i = index.frontCasted<ColumnIndex>();
switch (i)