Improve handling of spell check state

This commit is contained in:
Veronica Berglyd Olsen
2023-09-14 16:26:05 +02:00
parent 309c7de5de
commit c3a4b840fb
5 changed files with 35 additions and 28 deletions
+11 -1
View File
@@ -28,7 +28,7 @@ import logging
from time import time
from PyQt5.QtGui import QTextCursor, QTextDocument
from PyQt5.QtCore import QObject
from PyQt5.QtCore import QObject, pyqtSlot
from PyQt5.QtWidgets import QPlainTextDocumentLayout, qApp
from novelwriter import SHARED
@@ -113,4 +113,14 @@ class GuiTextDocument(QTextDocument):
return word, cPos, cLen, SHARED.spelling.suggestWords(word)
return "", -1, -1, []
##
# Public Slots
##
@pyqtSlot(bool)
def setSpellCheckState(self, state: bool) -> None:
"""Set the spell check state of the syntax highlighter."""
self._syntax.setSpellCheck(state)
return
# END Class GuiTextDocument