Important: Please read the Qt Code of Conduct -

Clearing a layout gets progressively slower?

  • This post is deleted!

  • @sam1
    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 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?

  • Lifetime Qt Champion


    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 ?

Log in to reply