The destruction sequence of top-level QWidgets results on QWidgetWindow sending an event to its widget while it's running ~QObject(), and therefore after it has run ~QWidget(). The sequence is (omitting a few calls):
This results in two issues. First, QWidgetWindow expects its widget to be a QWidget after ~QWidget() has been called. Second, any event filter or QApplication::notify() override has to deal with a QObject being deleted without having a way of checking that (as an example, trying to instantiate a QPointer with that object will cause an immediate assert failure).