QTextDocument

class PyQt5.QtGui.QTextDocument

C++ documentation