diff --git a/src/calibre/gui2/tweak_book/editor/__init__.py b/src/calibre/gui2/tweak_book/editor/__init__.py index 2ce54e4945..ab562d0bb4 100644 --- a/src/calibre/gui2/tweak_book/editor/__init__.py +++ b/src/calibre/gui2/tweak_book/editor/__init__.py @@ -6,7 +6,7 @@ from __future__ import (unicode_literals, division, absolute_import, __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal ' -from PyQt4.Qt import QTextCharFormat +from PyQt5.Qt import QTextCharFormat from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES from calibre.ebooks.oeb.polish.container import guess_type diff --git a/src/calibre/gui2/tweak_book/editor/syntax/html.py b/src/calibre/gui2/tweak_book/editor/syntax/html.py index cca17bd0b3..a52ae14c76 100644 --- a/src/calibre/gui2/tweak_book/editor/syntax/html.py +++ b/src/calibre/gui2/tweak_book/editor/syntax/html.py @@ -567,7 +567,7 @@ class XMLHighlighter(HTMLHighlighter): def profile(): import sys - from PyQt4.Qt import QTextDocument + from PyQt5.Qt import QTextDocument from calibre.gui2 import Application from calibre.gui2.tweak_book import set_book_locale from calibre.gui2.tweak_book.editor.themes import get_theme diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 8eb17086cb..bd983ee9d3 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -582,8 +582,8 @@ class TextEdit(PlainTextEdit): formats = self.highlighter.parse_single_block(c.block())[0] pos = c.positionInBlock() for r in formats: - if r.start <= pos < r.start + r.length and r.format.property(SPELL_PROPERTY).toBool(): - return r.format.property(SPELL_LOCALE_PROPERTY).toPyObject() + if r.start <= pos < r.start + r.length and r.format.property(SPELL_PROPERTY): + return r.format.property(SPELL_LOCALE_PROPERTY) def recheck_word(self, word, locale): c = self.textCursor()