I have my main application QWindow
where, when I press a QPushButton a new child window (a QWidget
) pops up. There are two ways of exiting the QWidget
window:
- Click the X in the top right hand corner, or
- Click on the 'Finished'
QPushButton
I have in theQWidget
window.
I would like to ensure that, when either method is used to exit the window, the QWidget
is deleted. I believe that I can ensure this in the second case by adding self.deleteLater()
to the function called when the 'Finished QPushButton
is clicked, but I am struggling to see how to do this in the first case.