Check out example codes for "remove item from layout". It will help you in understanding the concepts better.

Code Example 1

QLayoutItem* item;
while ( ( item = layout->takeAt( 0 ) ) != NULL )
{
    delete item->widget();
    delete item;
}
delete m_view->layout();

Learn ReactJs, React Native from akashmittal.com