def __init__(self, api, *args):
super().__init__(*args)
spell_check_lang = api.opt.general['spell_check']
try:
self._dictionary = (
enchant.Dict(spell_check_lang)
if spell_check_lang
else None)
except enchant.errors.DictNotFoundError:
self._dictionary = None
api.log.warn(f'dictionary {spell_check_lang} not installed.')
self._fmt = QtGui.QTextCharFormat()
self._fmt.setUnderlineColor(QtCore.Qt.red)
self._fmt.setUnderlineStyle(QtGui.QTextCharFormat.SpellCheckUnderline)
self._fmt.setFontUnderline(True)
评论列表
文章目录