From 469c975a708ed86c834b59ed751a4548c693a7b9 Mon Sep 17 00:00:00 2001
From: 李威 wei.li <108964761+liwey1985@users.noreply.github.com>
Date: 周一, 21 4月 2025 15:34:54 +0800
Subject: [PATCH] Fix NSWindowProxy::setSystemButtonVisible not taking effect (#175)

---
 examples/mainwindow/mainwindow.cpp |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/examples/mainwindow/mainwindow.cpp b/examples/mainwindow/mainwindow.cpp
index a8d2c61..fb3d5eb 100644
--- a/examples/mainwindow/mainwindow.cpp
+++ b/examples/mainwindow/mainwindow.cpp
@@ -210,6 +210,11 @@
                 });
 
 #elif defined(Q_OS_MAC)
+        // Set whether to use system buttons (close/minimize/zoom)
+        // - true:  Hide system buttons (use custom UI controls)
+        // - false: Show native system buttons (default behavior)
+        windowAgent->setWindowAttribute(QStringLiteral("no-system-buttons"), false);
+
         auto darkBlurAction = new QAction(tr("Dark blur"), menuBar);
         darkBlurAction->setCheckable(true);
         connect(darkBlurAction, &QAction::toggled, this, [this](bool checked) {

--
Gitblit v1.9.1