@Numerlor I would be surprised if the QWindow doesn't get a close event in all cases. Try calling myWidget.window().windowHandle() to get the QWindow...
Oh, but there is no close event for QWindow... I guess I would use it's QObject destroyed signal to get what you're looking for. That will be signaled immediately before the destruction of the window.