Is there any way I can get notified when a user closes a QMdiSubWindow? I cannot find any signal in QMdiArea nor in QMdiSubWindow that suggests I can.
I think my only chance is by subclassing QMdiSubWindow and overriding the close event, but is there any other way?
I don’t think there is any other way than as you describe (overriding the close event) to do precisely what you’re asking.
There might be other ways of achieving what you want without doing that depending on why you want to know when its closed. Other options could be the use of the destroyed signal, checking QApplication::focusWidget(), or perhaps having the parent inspect its children.
Edit in response to comment:
Signals and slots are disconnected automatically upon destruction of QObjects, and I would suggest looking at using QSharedPointers or QScopedPointers to handle your QObjects’ lifespans instead. By applying these techniques, you shouldn’t need a signal from a closed window.