728x90
void clearLayout(QLayout *layout) {
QLayoutItem *item;
while((item = layout->takeAt(0))) {
if (item->layout()) {
clearLayout(item->layout());
delete item->layout();
}
if (item->widget()) {
delete item->widget();
}
delete item;
}
}
출처 : https://stackoverflow.com/questions/4857188/clearing-a-layout-in-qt
728x90
'Programming > Qt' 카테고리의 다른 글
[QT] 윈도우 시리얼 포트 리스트 (QSerialInfo 사용 x) (0) | 2020.10.12 |
---|---|
Mainwindow 파일이 아닌 다른 cpp에서 ui 접근 (0) | 2020.06.05 |
Qt Popup window 사용하기 (0) | 2020.05.07 |
QPushButton 이미지 넣기 (2) | 2020.04.14 |
Qt 커스텀 위젯 사용하기 (0) | 2020.04.10 |