The QTextDocument class, part of the Qt framework, holds formatted text that can be viewed and edited using a QTextEdit.