Add workaround for a macOS-only Qt crash (#866)

QTBUG: https://bugreports.qt.io/browse/QTBUG-102107

Co-authored-by: guihkx <626206+guihkx@users.noreply.github.com>
This commit is contained in:
martinrotter 2023-01-04 14:17:38 +01:00 committed by GitHub
parent e87ecd91f2
commit 454cca6711
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -267,6 +267,12 @@ void FormMain::prepareMenus() {
if (QSysInfo::currentCpuArchitecture().contains(QSL("arm"), Qt::CaseSensitivity::CaseInsensitive)) {
qWarningNN << LOGSEC_GUI << "Disabling native menu bar.";
m_ui->m_menuBar->setNativeMenuBar(false);
#if defined(Q_OS_MACOS)
// This works around a macOS-only Qt crash.
// QTBUG: https://bugreports.qt.io/browse/QTBUG-102107
// TODO: Remove this workaround once the upstream bug gets addressed.
m_ui->m_menuBar->setCornerWidget(nullptr);
#endif
}
}