From 5dcc1ad413c05b0c47ec624e3b957f550a99e834 Mon Sep 17 00:00:00 2001 From: Manuel Kaufmann Date: Tue, 5 May 2026 18:38:31 +0200 Subject: [PATCH] Display icon in macos dock Set the dock icon correctly on macOS --- aitviewer/viewer.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aitviewer/viewer.py b/aitviewer/viewer.py index d235459..6f35f59 100644 --- a/aitviewer/viewer.py +++ b/aitviewer/viewer.py @@ -155,6 +155,15 @@ def __init__( self.window.set_icon(icon_path=icon_path) except: pass + if sys.platform == "darwin": + # On macOS the dock icon must be set at the QApplication level. + if self.window_type == "pyqt6": + from PyQt6.QtGui import QIcon + from PyQt6.QtWidgets import QApplication + else: + from PyQt5.QtGui import QIcon + from PyQt5.QtWidgets import QApplication + QApplication.instance().setWindowIcon(QIcon(icon_path)) self.timer = PerfTimer() self.ctx = self.window.ctx