I have one button on MainWindow
to show another QMainWindow
.
void MainWindow::viewSecondWindow()
{
QMainWindow w = new QMainWindow(this);
w.show();
}
The code got compiled well and ran succesfully. However if I click on the button , the second window does pop out but it automatically closes.
Edit :
For the future people who face similiar situation, please refer to this. Why use pointers?