Hi,
What should be the count of children()?? I think it should be 3. But it shows 0. Can anyone correct me...

Qt Code:
  1. class mainObject : public QObject{
  2. public:
  3. mainObject( QObject * parent = 0 ){}
  4. ~mainObject(){}
  5. };
  6.  
  7. class myObject : public mainObject{
  8. public:
  9. myObject( QObject * parent = 0 ) : mainObject( parent ){}
  10. ~myObject(){}
  11. };
  12.  
  13. int main(int argc, char *argv[]){
  14. mainObject* ob = new mainObject;
  15. myObject* a = new myObject(ob);
  16. myObject* b = new myObject(ob);
  17. myObject* c = new myObject(ob);
  18.  
  19. qDebug() << ob->children().count();
  20. return 0;
  21. }
To copy to clipboard, switch view to plain text mode 

Thanks