Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to launch mainwindow from a dialog window?
DanqueDynasty last edited by
Ok, so the program starts out with a dialog window requesting information from the user to log on. How can I get the mainWindow to open from the dialog window. Thanks.
Keozon last edited by
Off the top of my head, I would implement it like this.
Note the missing b.show(); command.
Then, in the constructor for MyMainWindow,
MyOpenDialog *a = new MyOpenDialog();
As long as MyOpenDialog is set as Application Modal, you won't process the this.show() until after the dialog has closed.
Edit: I should add, if you're all done with MyOpenDialog, you'll want to
@delete a;@ afterwards this.show();
yupifourbi last edited by
Would you mind to show in complete file MyMainWindow.cpp?
Thanks in advance.
Sirius27 last edited by
bq. MyOpenDialog *a = new MyOpenDialog();
i think the a->exec() should be followed by some check-up functions that call the .show() if log in was successful.
go for it !