Oh, I see now.i use qlayout::removeitem() but it doesn't get removed.
But you "are doing it without doing it".
What I mean is, you ask the layout for the items.
Instead, you must have the pointers to the objects somewhere right, so use these pointers in remoevItem() - don't ask the layout for them.
To do it the way you are doing it, you need to keep track of everything you add and remove to the layout, but why would you want to do that - that is what the layout it for!
Asking the layout for the viewer in a given cell only guarantees you that you get a pointer to a viewer (if any) which is in that cell - but if your bookkeeping is wrong, you are not getting the viewer you expect, or, not any viewer at all.
Bookmarks