diff options
author | Eirik Aavitsland <[email protected]> | 2025-10-10 17:12:06 +0200 |
---|---|---|
committer | Eirik Aavitsland <[email protected]> | 2025-10-22 00:30:55 +0200 |
commit | 4fa5149113dba1ed6d1194c63386b045393dd3a9 (patch) | |
tree | 12b255b14d2c7a6e1c381b9d027021ec1b52d840 | |
parent | d485badfd6c0f730d72fea379389f1948baf504f (diff) |
QMdiSubWindow: Respect null icon setting on Mac
On Mac, a QMdiSubWindow title bar by default shows no icon. However,
if an icon is then set on it, there would be no way to return to the
initial no-icon-shown state. Setting a null icon would only result in
the default window icon to be shown instead. This commit fixes that.
Fixes: QTBUG-139345
Pick-to: 6.10 6.8
Change-Id: I456a2cbdc4b81312a2959bc0f84a1dd545908b1f
Reviewed-by: Tor Arne Vestbø <[email protected]>
-rw-r--r-- | src/widgets/widgets/qmdisubwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp index 1ca6b8a47a1..7aff0da3327 100644 --- a/src/widgets/widgets/qmdisubwindow.cpp +++ b/src/widgets/widgets/qmdisubwindow.cpp @@ -2220,7 +2220,7 @@ QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags) d->titleBarPalette = d->desktopPalette(); d->font = QApplication::font("QMdiSubWindowTitleBar"); // We don't want the menu icon by default on mac. -#ifndef Q_OS_MAC +#ifndef Q_OS_DARWIN if (windowIcon().isNull()) d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, nullptr, this); else @@ -2847,8 +2847,11 @@ bool QMdiSubWindow::event(QEvent *event) break; case QEvent::WindowIconChange: d->menuIcon = windowIcon(); + // We don't want the default menu icon on mac. +#ifndef Q_OS_DARWIN if (d->menuIcon.isNull()) d->menuIcon = style()->standardIcon(QStyle::SP_TitleBarMenuButton, nullptr, this); +#endif if (d->controlContainer) d->controlContainer->updateWindowIcon(d->menuIcon); if (!maximizedSystemMenuIconWidget()) |