Values the following code examples produce are huge address like values. 194083216 The long-type value should have been a 3.
- Code: Select all
typedef QSharedPointer<qx::IxPersistable> QxObject_ptr;
QxObjectInfo::QxObjectInfo(const QxObject_ptr& obj)
{
if (!obj.isNull())
{
const qx::IxClass* ic = obj->qxClass();
if(ic)
{
qx::IxDataMemberX* icdmx = ic->getDataMemberX();
for (int i = 0; i < icdmx->count_WithDaoStrategy(); i++)
{
const qx::IxDataMember* icdm = icdmx->get_WithDaoStrategy(i);
if (icdm)
{
if (icdm->getIsPrimaryKey())
{
QString classType = ic->getKey();
key = icdm->toVariant(obj.data());
hash = classType % key.toString();
break;
}
}
}
}
}
}
- Code: Select all
typedef QSharedPointer<qx::IxPersistable> QxObject_ptr;
QxObjectInfo::QxObjectInfo(const QxObject_ptr& obj)
{
if (!obj.isNull())
{
const qx::IxClass* ic = obj->qxClass();
if(ic)
{
const qx::IxDataMember* idm = ic->getId(true);
if (idm)
{
QString classType = ic->getKey();
key = idm->toVariant(obj.data());
hash = classType % key.toString();
}
}
}
}
Thanks,
-SH