Qt UI: fix menu bar on MacOS (#668)

MacOS requires a 'global' menubar to be available (e.g. QtMenuBar(nullptr)).
This commit is contained in:
Thomas 2024-12-06 19:04:00 +01:00 committed by GitHub
parent 4606be05ec
commit 1d2429c3ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -31,8 +31,7 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent)
appRunning = true;
// Set our menu bar up
menuBar = new QMenuBar(this);
setMenuBar(menuBar);
menuBar = new QMenuBar(nullptr);
// Create menu bar menus
auto fileMenu = menuBar->addMenu(tr("File"));
@ -77,6 +76,7 @@ MainWindow::MainWindow(QApplication* app, QWidget* parent) : QMainWindow(parent)
auto aboutAction = aboutMenu->addAction(tr("About Panda3DS"));
connect(aboutAction, &QAction::triggered, this, &MainWindow::showAboutMenu);
setMenuBar(menuBar);
emu->setOutputSize(screen->surfaceWidth, screen->surfaceHeight);