From 347cfa00a247a54bef290478715059e14da0c664 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Fri, 26 Jan 2018 14:29:06 -0800 Subject: [PATCH] QMdiSubWindow: Hide "system" menu icons on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not only they should not appear (icons in menus is a special thing on macOS), they don't match the look on the window frame buttons. So, it's better to hide them completely. Change-Id: I8814ed3e128480abff4f53fdd40a0bb13f1796ef Reviewed-by: Morten Johan Sørvig --- src/widgets/widgets/qmdisubwindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index 0fdeaeb1e6..794674c427 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -1986,6 +1986,13 @@ void QMdiSubWindowPrivate::updateActions() for (int i = 0; i < NumWindowStateActions; ++i) setVisible(WindowStateAction(i), false); +#ifdef Q_OS_MACOS + if (q_func()->style()->inherits("QMacStyle")) + for (int i = 0; i < NumWindowStateActions; ++i) + if (QAction *action = actions[i]) + action->setIconVisibleInMenu(false); +#endif + if (windowFlags & Qt::FramelessWindowHint) return;