QWizard/AeroStyle: Fix crash when Qt::AA_NativeWindows is set

Prevent recursive platform window creation from the events
received during window creation (WM_POSCHANGING, etc).

Fixes: QTBUG-78300
Change-Id: Ie2bb4308af645c30e556666589e2dd08f14d4035
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
This commit is contained in:
Friedemann Kleint 2019-09-18 10:18:31 +02:00
parent 20d8186c24
commit 6c0e1dba40

View File

@ -3267,7 +3267,10 @@ bool QWizard::nativeEvent(const QByteArray &eventType, void *message, long *resu
if (QVistaHelper::vistaState() != d->vistaState) {
d->vistaState = QVistaHelper::vistaState();
d->vistaStateChanged = true;
setWizardStyle(AeroStyle);
// QTBUG-78300: When Qt::AA_NativeWindows is set, delay further
// window creation until after the platform window creation events.
if (windowsMessage->message == WM_GETICON)
setWizardStyle(AeroStyle);
}
return winEventResult;
} else {