Zlatomir, there is no interface (that I can find) to remove a widget from a QLayoutItem -- once it's in the layout item you can only delete the layout item.
[To the OP:]
Might we ask why you want to do all this in the first place? Why don't you just delete the entire layout and be done with it?
At the very least, change your loop to work from the end backwards, or just delete item(0) cnt times.
And remember, you need to check the item type. An item may be a spacer, or another layout.
[And thanks to this strange forum software for glomming all my posts together, even though the later ones are directed at the OP.]
Bookmarks