PDA

View Full Version : How to trigger a method after closing a dialog box



GeneCode
20th November 2017, 01:40
I made a simple tool application. There is a settings button that opens a settings dialog window.
There is a save button that saves the settings and closes the window. What i want is
how to make the main window execute a particular function when the dialog is closed.

ChrisW67
20th November 2017, 03:24
Is the dialog opened as modal or non-modal (i.e. QDialog::exec() or show()) ?

If opened modal then simply check the QDialog::exec() return value to see if it was Accepted or Rejected and act accordingly.
If opened non-modal then connect a slot to the accepted() signal from the dialog and do things there.