Open a QMainWindow Object in QDialog Object
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,
Code:
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.
Re: Open a QMainWindow Object in QDialog Object
in your qdialog
Code:
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! ;)