More pyqt6 goodness

Have to wrap locales in QVariant otherwise pyqt6 treats them a
QList<QTextLength>
This commit is contained in:
Kovid Goyal 2022-02-04 12:45:25 +05:30
parent f375ec0809
commit c576510227
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -7,7 +7,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import re import re
from collections import namedtuple from collections import namedtuple
from functools import partial from functools import partial
from qt.core import QFont, QTextBlockUserData, QTextCharFormat from qt.core import QFont, QTextBlockUserData, QTextCharFormat, QVariant
from calibre.ebooks.oeb.polish.spell import html_spell_tags, patterns, xml_spell_tags from calibre.ebooks.oeb.polish.spell import html_spell_tags, patterns, xml_spell_tags
from calibre.gui2.tweak_book import dictionaries, tprefs, verify_link from calibre.gui2.tweak_book import dictionaries, tprefs, verify_link
@ -71,7 +71,7 @@ State = _speedup.State
def spell_property(sfmt, locale): def spell_property(sfmt, locale):
s = QTextCharFormat(sfmt) s = QTextCharFormat(sfmt)
s.setProperty(SPELL_LOCALE_PROPERTY, locale) s.setProperty(SPELL_LOCALE_PROPERTY, QVariant(locale))
return s return s