The lastest Qt 5.12.4 has severely broken our app Sigil. It seems that any time a floating QDialog is closed via the titlebar x close, it corrupts something resulting in syncBackingStore invoking QWidget::mapTo which segfaults when it sees the eventual parent (w) is null (ie the window is top level with a null parent).
I have attached a standalone test case to illustrate the issue. It uses a QWebEngineView in a floating non-modal QDialog but any content that needs a backing store is enough to cause the crash.
Note the crash only happens with Qt 5.12.4 (all earlier Qt 5.12.X version work just fine).
To reproduce on macOS (and Linux):
A floating QDialog will be shown. Hit the close x on its title bar.
Once the close is detected, the MainWindow will try to show the QDialog again but
will either show nothing (rare) or will segfault in QWidget::mapTo.
Here is the original backtrace on Linux from Sigil:
And here is the segfault backtrace from this test program on macOS.
Please note, calling close directly on the QDialog has no problems. So somehow invoking the close x on the titlebar is changing or corrupting something.
FWIW, the same problem happens with undocked QDockWidget windows.
INtroduced by "Reset QWidget's winId when backing window surface is destroyed" a9246c7132a2c8864d3ae6cebd260bb9ee711fcb https://codereview.qt-project.org/c/qt/qtbase/+/261247