test: Nudge toward QT_STYLE_OVERRIDE=fusion on macOS

Using the Fusion style works around QTBUG-49686.

Otherwise, there could be a nullptr-deref under the QMacStyle.
This commit is contained in:
MarcoFalke
2026-07-22 13:48:49 +02:00
parent faa50c08b1
commit fa0c8337a8

View File

@@ -66,6 +66,12 @@ int main(int argc, char* argv[])
setenv("QT_QPA_PLATFORM", "minimal", 0 /* overwrite */);
#endif
#ifdef Q_OS_MACOS
// QMacStyle assumes a Cocoa platform window, which the minimal platform
// does not provide. In particular, painting a QGroupBox can make Qt call
// addSubview: on an invalid native object (QTBUG-49686).
setenv("QT_STYLE_OVERRIDE", "fusion", 0 /* overwrite */);
#endif
QCoreApplication::setOrganizationName(QAPP_ORG_NAME);
QCoreApplication::setApplicationName(QAPP_APP_NAME_DEFAULT "-test");