Method to close the application and go through the close event!?
I want to use qApp->exit(0) or qApp->quit() in order to close my application while being in a QDialog (e.g. a button in a dialog saying "Exit").
qApp->exit and qApp->quit do the job but, as I noticed they don't go through the QClose Event. Is there a way to go through the QClose Event of the main application and not through the dialog's Close Event?
Re: Method to close the application and go through the close event!?
Since QApplication is not a QWidget, it is not strange that it doesn't have a closeEvent(). Maybe it would be an idea for you to connect to the QCoreApplication::aboutToQuit() signal.
Re: Method to close the application and go through the close event!?
I just tell the main window to close(). It's sufficient in my case, may not be in yours if you have more than one.