vermarajeev
14th May 2007, 15:09
Hi,
What should be the count of children()?? I think it should be 3. But it shows 0. Can anyone correct me...
class mainObject : public QObject{
public:
mainObject( QObject * parent = 0 ){}
~mainObject(){}
};
class myObject : public mainObject{
public:
myObject( QObject * parent = 0 ) : mainObject( parent ){}
~myObject(){}
};
int main(int argc, char *argv[]){
mainObject* ob = new mainObject;
myObject* a = new myObject(ob);
myObject* b = new myObject(ob);
myObject* c = new myObject(ob);
qDebug() << ob->children().count();
return 0;
}
Thanks
What should be the count of children()?? I think it should be 3. But it shows 0. Can anyone correct me...
class mainObject : public QObject{
public:
mainObject( QObject * parent = 0 ){}
~mainObject(){}
};
class myObject : public mainObject{
public:
myObject( QObject * parent = 0 ) : mainObject( parent ){}
~myObject(){}
};
int main(int argc, char *argv[]){
mainObject* ob = new mainObject;
myObject* a = new myObject(ob);
myObject* b = new myObject(ob);
myObject* c = new myObject(ob);
qDebug() << ob->children().count();
return 0;
}
Thanks