Page 1 of 1

Introspection: getBaseClass returns NULL

PostPosted: Mon Aug 22, 2016 8:11 pm
by gianks
Hi,
again on introspection i'm having trouble in the attempt to list the fields of the base class of the qx::IxClass i'm iterating over.
All the IxClasses are returning false to isFinalClass even if some are deriving from QObject, some from nothing (so no_traits has been used) or from an already registered base class.
I tried to query an object and the select query was complete of all members of the base class and indeed QxOrm is working fine except for this.

All the classes return NULL is i call getBaseClass.
Can this be connected on the issue in my last thread?

I'm starting from the collection returned in this line, taken if i remember well from the example:
Code: Select all
qx::QxCollection<QString, qx::IxClass *> * pAllClasses = qx::QxClassX::getAllClasses();


Thanks a lot!

Re: Introspection: getBaseClass returns NULL

PostPosted: Mon Aug 22, 2016 10:34 pm
by gianks
Ok, i fixed my code following the example which uses a test like: pClass->getBaseClass ? ... : ... ;
Indeed wasn't true getBaseClass was returning NULL every time since it was checked after the isFinalClass() call which returns (still) always false, contrariously of what is stated in the class comments.
Maybe is a bug?

Re: Introspection: getBaseClass returns NULL

PostPosted: Tue Aug 23, 2016 9:56 am
by qxorm
qx::IxClass::isFinalClass() method returns true only for :
- qx::QxClass<qx::trait::no_base_class_defined> type ;
- and qx::QxClass<QObject> type.

In your case, you have to use the qx::IxClass::getBaseClass() method only.

Re: Introspection: getBaseClass returns NULL

PostPosted: Wed Aug 24, 2016 2:21 pm
by gianks
Sorry for my misunderstanding!
Now i got it, i thought it was supposed to be set for classes directly derived from those two!!
Thanks 8-)