Does deleting layout deletes its sublayouts?
问题 I am working on Qt application. There I am creating layout and adding sublayout. I have seen that calling addLayout() sets as parent the container layout. Does that implies than when I delete superlayout its descendants will get deleted too? QWidget* centralWidget = new QWidget(this); QVBoxLayout *mainLayout = new QVBoxLayout(centralWidget); QFormLayout *formLayout = new QFormLayout; mainLayout->addLayout(formLayout); Will deleting centralWidget delete formLayout? Thanks and regards 回答1: