How to remove QObject from parent
According to the Qt5 Doc
You can also delete child objects yourself, and they will remove themselves from their parents.
You're correct. To make a QObject
an orphan, simply do
// on C++11 compiler
object->setParent(nullptr);
// on a pre-C++11 compiler
object->setParent(0);