In my Qt program I have a main window and a dialog window. The main window has options for the user to choose from and the dialog window which is called from the main window constructor asks the user for their password which it needs in order to perform its operations. I want to link the two windows in such a way that when the user tries to close out of the dialog window by pressing the standard X button in the upper right corner the whole program will close not just that window.
I think I found the answer to my problem here Qt: How do I handle the event of the user pressing the 'X' (close) button? and I copied the implementation of the overridden reject function and just changed MyDialog to the class name of my dialog window but for me I'm getting an error saying that no member function "reject()" has been declared in my dialog window class even though it has QDialog included #include and my dialog window class inherits from it all in the header file which is of course included in its cpp file.
Did I run into a funky bug with Qt? On a side note as it is I think it's a shame that the Qt devs never made those three standard buttons in the upper right corner predefined slots so the connect() function could be used instead.