Krita Source Code Documentation
Loading...
Searching...
No Matches
docwrapper.py
Go to the documentation of this file.
1"""
2SPDX-FileCopyrightText: 2017 Eliakin Costa <eliakim170@gmail.com>
3
4SPDX-License-Identifier: GPL-2.0-or-later
5"""
6try:
7 from PyQt6.QtGui import QTextCursor
8except:
9 from PyQt5.QtGui import QTextCursor
10
11
12class DocWrapper(object):
13
14 def __init__(self, textdocument):
15 self.textdocument = textdocument
16
17 def write(self, text, view=None):
18 cursor = QTextCursor(self.textdocument)
19 cursor.clearSelection()
20 cursor.movePosition(QTextCursor.MoveOperation.End)
21 cursor.insertText(text)