On 01/04/2022 16:17, Michael Jackson wrote:
I have a bit of code where in I am removing a QWidget from the UI and it needs 
to be truly cleaned up as its parent QObject is also being cleaned up. I 
thought I did the appropriate:

layout->removeWidget(widget);
widget->setParent(nullptr);
widget->deleteLater();

Why not simply delete the parent, which will then delete all its children immediately?

Also, I don't even remember a single case where I ever needed deleteLater().

_______________________________________________
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest

Reply via email to