Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Clearing a layout gets progressively slower?
sam1 last edited by
This post is deleted!
JonB last edited by JonB
I don't know if this right/relevant to whatever your slowness is about.
I'm not sure in Python you are deleting as much as you need to. I think you want an
item.deleteLater()too. I'm basing this on https://stackoverflow.com/a/28940138/489865. That one is simple looking, you should also look at the other answers there, and comments.
Don't forget you must let the code back to the event loop if you've gone
deleteLater(), but you're probably doing that.
Otherwise, where exactly do you mean you get the slowness?
If you want to nuke everything every time, wouldn't it be simpler to have a "container" widget that you delete and replace with a new one.
In any case, can you explain the motivation behind removing everything like you do ?