From cff77aab396280875553e03659fc2f4267c6c285 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 14 Jan 2022 14:22:25 +0530 Subject: [PATCH] Simple QIcon.ic implementation Can be used for new code so that it works in master and qt6 branches --- src/calibre/gui2/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/calibre/gui2/__init__.py b/src/calibre/gui2/__init__.py index 8d277a4af0..4bcf3db57a 100644 --- a/src/calibre/gui2/__init__.py +++ b/src/calibre/gui2/__init__.py @@ -44,6 +44,13 @@ except AttributeError: NO_URL_FORMATTING = getattr(QUrl, 'None') +def load_icon(name): + return QIcon(I(name)) + + +QIcon.ic = load_icon + + # Setup gprefs {{{ gprefs = JSONConfig('gui')