QT button 클릭시 layout삭제하는 법을 알고 싶습니다.

asz3740의 이미지


QFormLayout *layout = new QFormLayout;
for (int i=0;i<15;i++)
{
QLineEdit *line = new QLineEdit(QString::fromUtf8(" 2208 박건도 "));
QPushButton *boton = new QPushButton(QString::fromUtf8("정지 "));
layout->addRow(line,boton);
}

ui->scrollContents->setLayout(layout);

void MainWindow::on_PBman_toggled(bool checked)
{
if(checked)
{

}
else
{
}

if문 부분에 삭제 하는 코드를 넣고 싶습니다.

File attachments: