@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.
29 August 2022
I'd have to dive into the sources, or we could ask @ctismer . I'm sure he'd know off the top of his head :)