I am new to Qt and am trying to understand object destruction and where I need to explicitly destroy objects using delete.class MainDialog: public QWidget {        Q_OBJECT    public: MainDialog(QWidget *parent=0);    private:        QPushButton *m_newClick;          QPushButton *m_editClick;         MainContact *m_contact;    }MainDialog::MainDialog(QWidget *parent):QWidget(parent) {    QWidget *container= new QWidget();    QPushButton *m_newClick =new QPushButton(New, container);    QPushButton *m_editClick= new QPushButton(Edit, container);    QLineEdit *m_text=new QLineEdit(container);    QVBoxLayout *vlayout=new QVBoxLayout();    QHBoxLayout *hlayout=new QHBoxLayout();    hlayout->addWidget(m_newClick);    hlayout->addWidget(m_editClick);    vlayout->addLayout(hlayout);    connect(m_viewClick,SIGNAL(clicked()),this,SLOT(viewClick()) );    connect(m_newClick,SIGNAL(clicked()),this,SLOT(newClick()) );    setWindowTitle(Welcome);    setLayout(vlayout);}My queries:Will the Pushbuttons and lineEdits get destroyed once container is destroyed?Do I need to destroy m_contact separately as it is not part of the container?I would like a small explanation on the parent child object destruction as well.
Object destruction in Qt dialog
c++;object oriented;qt