Happy new Year
I have a QGridLayout and added some QLayouts, which I want to remove now:
leftBox->addLayout(itemList[itemID]);
leftBox->removeItem(itemList[itemID]);
itemList[itemID]->setParent(0);
leftBox->addLayout(itemList[itemID]);
leftBox->removeItem(itemList[itemID]);
itemList[itemID]->setParent(0);
To copy to clipboard, switch view to plain text mode
leftBox is my QGridLayout
itemList is a QList which contains Points of QHBoxLayout. The adding of the layouts is no problem.
In this example I want to remove them immediatly. removeItems() puts the removed layouts to the same place (left top corner of the leftBox). I actually thought this is as the added Layouts have still leftBox as parent. So I set another parent, which was useless.
So how can I remove this layouts without deleting the removed layout as I want to add it later again?
Bookmarks