
Alternatively, if you just want to iterate over the textual contents of the document you can use begin(), end(), and findBlock() to retrieve text blocks that you can examine and iterate over. The entire document structure is stored as a hierarchy of document elements beneath the root frame, found with the rootFrame() function. Each format object is treated as a unique object by QTextDocuments, and can be passed to objectForFormat() to obtain the document element that it is applied to.Ī QTextDocument can be edited programmatically using a QTextCursor, and its contents can be examined by traversing the document structure. They can be created for use in a QTextEdit, or used independently.Įach document element is described by an associated format object. QTextDocument is a container for structured rich text documents, providing support for styled text and various types of document elements, such as lists, tables, frames, and images.

()ĭef clearUndoRedoStacks ()ĭef drawContents (painter)ĭef find (expr, cursor)ĭef find (expr])ĭef find (subString, cursor)ĭef find (subString])ĭef setMarkdown (markdown)ĭef toMarkdown ().
