This commit is contained in:
Tim Bentley 2014-01-04 18:00:43 +00:00
commit 060f56c76b
1 changed files with 4 additions and 2 deletions

View File

@ -133,7 +133,7 @@ class SpellTextEdit(QtGui.QPlainTextEdit):
"""
self.dictionary = enchant.Dict(action.text())
self.highlighter.spelling_dictionary = self.dictionary
self.highlighter.highlight_block(self.toPlainText())
self.highlighter.highlightBlock(self.toPlainText())
self.highlighter.rehighlight()
def correct_word(self, word):
@ -180,9 +180,11 @@ class Highlighter(QtGui.QSyntaxHighlighter):
super(Highlighter, self).__init__(*args)
self.spelling_dictionary = None
def highlight_block(self, text):
def highlightBlock(self, text):
"""
Highlight misspelt words in a block of text.
Note, this is a Qt hook.
"""
if not self.spelling_dictionary:
return