1
0

qt: fix: set ApplicationAttribute.AA_DontShowIconsInMenus False

Explicitly sets the AA_DontShowIconsInMenus attribute to false as it
defaults to true on some Qt versions / environments which causes icons
to not show up in the menus (e.g. MacOS).
see https://forum.qt.io/post/813228
The attribute has to be set on self.app after the QApplication has been
instanciated (https://doc.qt.io/qt-6/qt.html#ApplicationAttribute-enum)
This commit is contained in:
f321x
2025-06-13 10:59:43 +02:00
parent 440c1e91a0
commit cc848be61c

View File

@@ -157,6 +157,8 @@ class ElectrumGui(BaseElectrumGui, Logger):
self.screenshot_protection_efilter = ScreenshotProtectionEventFilter()
if sys.platform in ['win32', 'windows'] and self.config.GUI_QT_SCREENSHOT_PROTECTION:
self.app.installEventFilter(self.screenshot_protection_efilter)
# explicitly set 'AA_DontShowIconsInMenus' False so menu icons are shown on MacOS
self.app.setAttribute(Qt.ApplicationAttribute.AA_DontShowIconsInMenus, on=False)
self.app.setWindowIcon(read_QIcon("electrum.png"))
self.translator = ElectrumTranslator()
self.app.installTranslator(self.translator)