Getting the text under cursor with QScintilla
Solved
General and Desktop
-
wrote on 25 Jan 2019, 20:39 last edited by
With QPlainTextEdit, I could get the text under cursor easily, like this:
textCursor = self.textCursor() textCursor.select(QTextCursor.WordUnderCursor) text = textCursor.selectedText()
But QScintilla doesn't have a self.textCursor() method so what is the solution?
I looked through the docs but nothing catched my eye -
Hi,
That's question better asked on the Riverbank dedicated mailing list as it's their product.
-
wrote on 26 Jan 2019, 11:44 last edited by
If someone is wondering how it's done, it's this easy:
print(self.wordAtLineIndex(self.getCursorPosition()[0], self.getCursorPosition()[1]))
3/3