1 QLayout* pLayout = (QLayout*)ui->frame->layout(); 2 while(child = pLayout->takeAt(0)) 3 { 4 QWidget* pWidget = child->widget(); 5 pWidget->deleteLater(); 6 delete child; 7 }
转载于:https://www.cnblogs.com/john-h/p/8567061.html
1 QLayout* pLayout = (QLayout*)ui->frame->layout(); 2 while(child = pLayout->takeAt(0)) 3 { 4 QWidget* pWidget = child->widget(); 5 pWidget->deleteLater(); 6 delete child; 7 }
转载于:https://www.cnblogs.com/john-h/p/8567061.html