From 2ba2439e6f15c173e644fedddb9abd4499d7f9aa Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 19 Nov 2021 19:58:51 +0530 Subject: [PATCH] Another PyQt enum waste of time --- src/calibre/gui2/tweak_book/editor/themes.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/tweak_book/editor/themes.py b/src/calibre/gui2/tweak_book/editor/themes.py index 0cf752f088..cb83b95774 100644 --- a/src/calibre/gui2/tweak_book/editor/themes.py +++ b/src/calibre/gui2/tweak_book/editor/themes.py @@ -248,7 +248,7 @@ def u(x): return x + 'Underline' -underline_styles = {x:getattr(QTextCharFormat, u(x)) for x in underline_styles} +underline_styles = {x:getattr(QTextCharFormat.UnderlineStyle, u(x)) for x in underline_styles} def to_highlight(data): @@ -694,7 +694,8 @@ class ThemeEditor(Dialog): if __name__ == '__main__': - app = QApplication([]) + from calibre.gui2 import Application + app = Application([]) d = ThemeEditor() d.exec_() del app