Introspection: getBaseClass returns NULL

Forum for posting problems using QxOrm library

Introspection: getBaseClass returns NULL

Postby gianks » Mon Aug 22, 2016 8:11 pm

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!
gianks
 
Posts: 45
Joined: Mon Jul 04, 2016 1:04 pm

Re: Introspection: getBaseClass returns NULL

Postby gianks » Mon Aug 22, 2016 10:34 pm

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?
gianks
 
Posts: 45
Joined: Mon Jul 04, 2016 1:04 pm

Re: Introspection: getBaseClass returns NULL

Postby qxorm » Tue Aug 23, 2016 9:56 am

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.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Introspection: getBaseClass returns NULL

Postby gianks » Wed Aug 24, 2016 2:21 pm

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-)
gianks
 
Posts: 45
Joined: Mon Jul 04, 2016 1:04 pm


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 4 guests

cron