Add support for button icons stored in Qt resource system
This commit is contained in:
parent
fcfb45ccdf
commit
709bfa4a11
@ -145,7 +145,9 @@ class Editor:
|
|||||||
def _addButton(self, icon, cmd, tip="", label="", id=None, toggleable=False,
|
def _addButton(self, icon, cmd, tip="", label="", id=None, toggleable=False,
|
||||||
disables=True):
|
disables=True):
|
||||||
if icon:
|
if icon:
|
||||||
if os.path.isabs(icon):
|
if icon.startswith("qrc:/"):
|
||||||
|
iconstr = icon
|
||||||
|
elif os.path.isabs(icon):
|
||||||
iconstr = self.resourceToData(icon)
|
iconstr = self.resourceToData(icon)
|
||||||
else:
|
else:
|
||||||
iconstr = "/_anki/imgs/{}.png".format(icon)
|
iconstr = "/_anki/imgs/{}.png".format(icon)
|
||||||
|
Loading…
Reference in New Issue
Block a user