How to open a new window from the main window in Qt?

qt, window

Solution

From a slot in your MainWindow call this code :

QWidget *wdg = new QWidget;
wdg->show();
hide();//this will disappear main window

Problem

I'm new to qt programming and would like to know how to open a new window from the main window with the mainwindow disappearing? Is there any source code I can have a look at?

Original source