Cursor position is now saved and loaded with the document.

This commit is contained in:
Veronica K. B. Olsen
2019-05-18 13:52:45 +02:00
parent cb71da5200
commit 19b2521b73
4 changed files with 26 additions and 3 deletions
+10
View File
@@ -120,6 +120,16 @@ class GuiDocEditor(QTextEdit):
theText = self.toPlainText()
return theText
def setCursorPosition(self, thePosition):
theCursor = self.textCursor()
theCursor.setPosition(thePosition)
self.setTextCursor(theCursor)
return True
def getCursorPosition(self):
theCursor = self.textCursor()
return theCursor.position()
##
# Spell Checking
##