Hi there,

I created a QObject based class passing another QObject as parent. Now I want to use the QObject somewhere else and need to reparent it. So far I use
Qt Code:
  1. // first
  2. MyClass * c1 = new MyClass(containerWidget);
  3. containerWidget->widgetList.append(c1);
  4.  
  5. // later
  6. MyClass * c2 = containerWidget->widgetList->takeAt(14);
  7. c2->setParent(newContainerWidget);
To copy to clipboard, switch view to plain text mode 

Is that enough? What happens, if containerWidget gets destroyed before newContainerWidget? Will it delete my class instance as well or does the setParent() call sever the parent-children connection completely?

Bye