PDA

View Full Version : Removing item from layout without deleting it.



mrc_pl
24th January 2012, 10:07
Hi. I've got a problem. I have a QFromLayout. And I want to remove item from layout without actual deleting that item. I've tried removeItem and takeAt functions but it doesn't work: items are still visible. My goal is to replace some items with others items, after button click, but I need to have access to data in items which aren't visible. Can you tell me what am I doing wrong?

wysota
24th January 2012, 11:00
Removing item from a layout doesn't remove it from the parent widget. If you want to remove a widget from its parent then call setParent() passing in 0.

mrc_pl
24th January 2012, 11:24
Thank you:) So simple solution.