From 709bfa4a113c71ad0fc1f55c72cf973981ce8324 Mon Sep 17 00:00:00 2001 From: Glutanimate Date: Sat, 26 Jan 2019 20:42:56 +0100 Subject: [PATCH] Add support for button icons stored in Qt resource system --- aqt/editor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aqt/editor.py b/aqt/editor.py index d564b2ad5..8a9c97e54 100644 --- a/aqt/editor.py +++ b/aqt/editor.py @@ -145,7 +145,9 @@ class Editor: def _addButton(self, icon, cmd, tip="", label="", id=None, toggleable=False, disables=True): if icon: - if os.path.isabs(icon): + if icon.startswith("qrc:/"): + iconstr = icon + elif os.path.isabs(icon): iconstr = self.resourceToData(icon) else: iconstr = "/_anki/imgs/{}.png".format(icon)