From 3beb835042dcdbafd50d5fd694a7137dff26b7cf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 16 Oct 2022 10:36:10 +0530 Subject: [PATCH] Use the correct style when custom painintg the icon --- src/calibre/gui2/library/delegates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/library/delegates.py b/src/calibre/gui2/library/delegates.py index e8c5c85481..4dcfc988b3 100644 --- a/src/calibre/gui2/library/delegates.py +++ b/src/calibre/gui2/library/delegates.py @@ -763,7 +763,7 @@ class CcBoolDelegate(QStyledItemDelegate, UpdateEditorGeometry): # {{{ self.nuke_option_data = True super().paint(painter, option, index) self.nuke_option_data = False - style = QApplication.style() + style = option.styleObject.style() if option.styleObject else QApplication.instance().style() style.drawItemPixmap(painter, option.rect, Qt.AlignmentFlag.AlignCenter, icon) # }}}