Skip to content

Commit cc848be

Browse files
committed
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)
1 parent 440c1e9 commit cc848be

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

electrum/gui/qt/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ def __init__(self, *, config: 'SimpleConfig', daemon: 'Daemon', plugins: 'Plugin
157157
self.screenshot_protection_efilter = ScreenshotProtectionEventFilter()
158158
if sys.platform in ['win32', 'windows'] and self.config.GUI_QT_SCREENSHOT_PROTECTION:
159159
self.app.installEventFilter(self.screenshot_protection_efilter)
160+
# explicitly set 'AA_DontShowIconsInMenus' False so menu icons are shown on MacOS
161+
self.app.setAttribute(Qt.ApplicationAttribute.AA_DontShowIconsInMenus, on=False)
160162
self.app.setWindowIcon(read_QIcon("electrum.png"))
161163
self.translator = ElectrumTranslator()
162164
self.app.installTranslator(self.translator)

0 commit comments

Comments
 (0)