PDA

View Full Version : Open a QMainWindow Object in QDialog Object



chuengchuenghq
13th June 2008, 05:06
I wanna open QMainWindow Object in QDialog Object:
in the login in dialog,as u see:
main dialog is a QDialog Object called frmlogin:
after close the main dialog,the QMainWindow called frmMain will appear.

this is the simply source,

this->close(); // close the main dialog
frmMain mainwindow(this);
mainwindow.show(); //show the QMainWindow

as u see,The mainwindow never appear.How can i do to let it work well?


thank for u all.

triperzonak
13th June 2008, 07:33
in your qdialog


connect (your_close_signal(maybe close button)), SIGNAL (clicked()),this , SLOT (show_frmmain()));

void yourdialog::show_frmmain()
{
frmMain *calfrm = new frmMain;
calfrm->show();
}


this is only one of many possible answers try to explore! ;)