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:
// first MyClass * c1 = new MyClass(containerWidget); containerWidget->widgetList.append(c1); // later MyClass * c2 = containerWidget->widgetList->takeAt(14); 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
Bookmarks