right way to open a new window
First when the application start I display the login screen. Then after successful login i have to display the main window. What is the right way to close the login screen and display the main window?
At the moment i have something like this:
Code:
main_window *main = new main_window();
this->close(); // close login
main->show(); // show main
When i call main_window *main = new main_window(this), then the application is not working right.
I have searched Qt examples & demos but all use just one window.
Re: right way to open a new window
Look at the following code
Will give you a basic Idea
Code:
int main( ... ) {
LoginDialog *loginDlg = new LoginDlg;
if( loginDlg->exec() != Qt:;Accepted ) {
return 0;
}
//check the login Info
delete loginDlg;
MainWindow w;
w.show()
return app.exec();
}