I'm trying to make a main window (QWidget) which open a new QWidget when a button is clicked but when I close the main window, the QWidget recently opened doesn't close.
main.cpp
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
mainwindow.cpp (parent)
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
out.cpp (child)
Out::Out(QWidget *parent) :
QWidget(parent),
ui(new Ui::Out)
{
ui->setupUi(this);
}