[SOLVED] Run Function on Dialog Close
-
wrote on 6 May 2014, 22:30 last edited by
The dialog window provides access to database, so when I close the dialog, I want my combobox to be updated with the updated information. I have been looking for way too long and have found answers that strayed from what I either understood or what my goal was, and the search function is terrible for trying to find specifics.
How can I, in some way, have my combobox query the db when the dialog box is closed? (Only need to know how to get the close event to my main window, and then I can run my update function when the close event returns true)
-
wrote on 7 May 2014, 00:55 last edited by
How do you show the dialog?
Normally you could do something like this:
@MyDialog *myDialog = new MyDialog(this);
myDialog->exec(); //blocks until dialog is done with!
doSomethingAfterDialog();@Other than that, you can of course re-implement the closeEvent() of your dialog class and then do whatever is needed there. Lats but not least, you could connect to the dialog's accepted() or finished() signal.
-
wrote on 7 May 2014, 01:50 last edited by
Thank you so much! I never even realized that anything below the execution was blocked, I was thinking far too into it and looked over the simple things :D
1/3