12/28/2022 0 Comments I deleted textedit document frame![]() ![]() This enum describes the options available to QTextDocument ‘s find function. Sequences of insertion or removals in a single operation (e.g., by selecting and then deleting text) are regarded as a single undo/redo operation. A sequence of insertions or removals within the same text block are regarded as a single undo/redo operation. The following are the undo/redo operations of a QTextDocument : The undo/redo system can be controlled by an editor widget through the undo() and redo() slots the document also provides contentsChanged(), undoAvailable(), and redoAvailable() signals that inform connected editor widgets about the state of the undo/redo system. Undo/redo of operations performed on the document can be controlled using the setUndoRedoEnabled() function. The document’s text can be searched using the find() functions. The toPlainText() and toHtml() convenience functions allow you to retrieve the contents of the document as plain text and HTML. For documents that are exposed to users through the QTextEdit class, the document title is also available via the documentTitle() function. The document’s title and other meta-information can be obtained by calling the metaInformation() function. The layout of a document is determined by the documentLayout() you can create your own QAbstractTextDocumentLayout subclass and set it using setDocumentLayout() if you want to use your own layout logic. 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. Def clearUndoRedoStacks ()ĭef drawContents (painter)ĭef find (expr, cursor)ĭef find (expr])ĭef find (subString, cursor)ĭef find (subString])ĭef setMarkdown (markdown)ĭef toMarkdown () ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |