clear qlayout code example Example: clear qlayout for(int i=0; i<my_layout->count(); i++){ delete my_layout->itemAt(i); }