QObject cloning
- by Olorin
I know that Qobjects are supposed to be identities not values eg you cannot copy them and by default the copy constructor and asignment are disabled as explained in qt documentation. But is it possible to create a new Qobject from an existing one using a clone method? Would this be a logic error ?
If i say
QObject b;
QObject a;
b.cloneFrom(a);
or
QObject a = new QBject();
QObject b = new QBject();
b->cloneFrom(a);
and the clone method copyes stuff like members etc would this be wrong?
And if this is ok can i write my own copy constructor and asignment operator that does just that?
Note: i actually want to try this with classes that inherit qobject.