<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- richtext.qdoc --> <title>Rich Text Processing | Qt GUI 5.9</title> <link rel="stylesheet" type="text/css" href="style/offline-simple.css" /> <script type="text/javascript"> document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css"); // loading style sheet breaks anchors that were jumped to before // so force jumping to anchor again setTimeout(function() { var anchor = location.hash; // need to jump to different anchor first (e.g. none) location.hash = "#"; setTimeout(function() { location.hash = anchor; }, 0); }, 0); </script> </head> <body> <div class="header" id="qtdocheader"> <div class="main"> <div class="main-rounded"> <div class="navigationbar"> <table><tr> <td >Qt 5.9</td><td ><a href="qtgui-index.html">Qt GUI</a></td><td >Rich Text Processing</td></tr></table><table class="buildversion"><tr> <td id="buildversion" width="100%" align="right">Qt 5.9.4 Reference Documentation</td> </tr></table> </div> </div> <div class="content"> <div class="line"> <div class="content mainContent"> <link rel="next" href="richtext-structure.html" /> <p class="naviNextPrevious headerNavi"> <a class="nextPage" href="richtext-structure.html">Rich Text Document Structure</a> </p><p/> <div class="sidebar"> <div class="toc"> <h3><a name="toc">Contents</a></h3> <ul> <li class="level1"><a href="#rich-text-processing-apis">Rich Text Processing APIs</a></li> </ul> </div> <div class="sidebar-content" id="sidebar-content"></div></div> <h1 class="title">Rich Text Processing</h1> <span class="subtitle"></span> <!-- $$$richtext.html-description --> <div class="descr"> <a name="details"></a> <p>The Scribe framework provides a set of classes for reading and manipulating structured rich text documents. Unlike previous rich text support in Qt, the new classes are centered around the <a href="qtextdocument.html">QTextDocument</a> class rather than raw textual information. This enables the developer to create and modify structured rich text documents without having to prepare content in an intermediate markup format.</p> <p>The information within a document can be accessed via two complementary interfaces: A cursor-based interface is used for editing, and a read-only hierarchical interface provides a high level overview of the document structure. The main advantage of the cursor-based interface is that the text can be edited using operations that mimic a user's interaction with an editor, without losing the underlying structure of the document. The read-only hierarchical interface is most useful when performing operations such as searching and document export.</p> <p>This document is divided up into chapters for convenient reference:</p> <ul> <li><a href="richtext-structure.html">Rich Text Document Structure</a> outlines the different kinds of elements in a <a href="qtextdocument.html">QTextDocument</a>, and describes how they are arranged in a document structure.</li> <li><a href="richtext-cursor.html">The QTextCursor Interface</a> explains how rich text documents can be edited using the cursor-based interface.</li> <li><a href="richtext-layouts.html">Document Layouts</a> briefly explains the role of document layouts.</li> <li><a href="richtext-common-tasks.html">Common Rich Text Editing Tasks</a> examines some common tasks that involve reading or manipulating rich text documents.</li> <li><a href="richtext-advanced-processing.html">Advanced Rich Text Processing</a> examines advanced rich text editing tasks.</li> <li><a href="richtext-html-subset.html">Supported HTML Subset</a> lists the HTML tags supported by <a href="qtextdocument.html">QTextDocument</a>.</li> </ul> <a name="rich-text-processing-apis"></a> <h2 id="rich-text-processing-apis">Rich Text Processing APIs</h2> <p>Qt provides an extensive collection of classes for parsing, rendering manipulating and editing rich text.</p> <div class="table"><table class="annotated"> <tr class="odd topAlign"><td class="tblName"><p><a href="qabstracttextdocumentlayout.html">QAbstractTextDocumentLayout</a></p></td><td class="tblDescr"><p>Abstract base class used to implement custom layouts for QTextDocuments</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qfont.html">QFont</a></p></td><td class="tblDescr"><p>Specifies a font used for drawing text</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qsyntaxhighlighter.html">QSyntaxHighlighter</a></p></td><td class="tblDescr"><p>Allows you to define syntax highlighting rules, and in addition you can use the class to query a document's current formatting or user data</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextcursor.html">QTextCursor</a></p></td><td class="tblDescr"><p>Offers an API to access and modify QTextDocuments</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextdocument.html">QTextDocument</a></p></td><td class="tblDescr"><p>Holds formatted text</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextdocumentfragment.html">QTextDocumentFragment</a></p></td><td class="tblDescr"><p>Represents a piece of formatted text from a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextdocumentwriter.html">QTextDocumentWriter</a></p></td><td class="tblDescr"><p>Format-independent interface for writing a QTextDocument to files or other devices</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextblockformat.html">QTextBlockFormat</a></p></td><td class="tblDescr"><p>Formatting information for blocks of text in a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextcharformat.html">QTextCharFormat</a></p></td><td class="tblDescr"><p>Formatting information for characters in a QTextDocument</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextformat.html">QTextFormat</a></p></td><td class="tblDescr"><p>Formatting information for a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextframeformat.html">QTextFrameFormat</a></p></td><td class="tblDescr"><p>Formatting information for frames in a QTextDocument</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextimageformat.html">QTextImageFormat</a></p></td><td class="tblDescr"><p>Formatting information for images in a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextlength.html">QTextLength</a></p></td><td class="tblDescr"><p>Encapsulates the different types of length used in a QTextDocument</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextlistformat.html">QTextListFormat</a></p></td><td class="tblDescr"><p>Formatting information for lists in a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtexttablecellformat.html">QTextTableCellFormat</a></p></td><td class="tblDescr"><p>Formatting information for table cells in a QTextDocument</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtexttableformat.html">QTextTableFormat</a></p></td><td class="tblDescr"><p>Formatting information for tables in a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextinlineobject.html">QTextInlineObject</a></p></td><td class="tblDescr"><p>Represents an inline object in a QAbstractTextDocumentLayout and its implementations</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextlayout.html">QTextLayout</a></p></td><td class="tblDescr"><p>Used to lay out and render text</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextline.html">QTextLine</a></p></td><td class="tblDescr"><p>Represents a line of text inside a QTextLayout</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextlist.html">QTextList</a></p></td><td class="tblDescr"><p>Decorated list of items in a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextblock.html">QTextBlock</a></p></td><td class="tblDescr"><p>Container for text fragments in a QTextDocument</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextblockgroup.html">QTextBlockGroup</a></p></td><td class="tblDescr"><p>Container for text blocks within a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextblockuserdata.html">QTextBlockUserData</a></p></td><td class="tblDescr"><p>Used to associate custom data with blocks of text</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextfragment.html">QTextFragment</a></p></td><td class="tblDescr"><p>Holds a piece of text in a QTextDocument with a single QTextCharFormat</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextframe.html">QTextFrame</a></p></td><td class="tblDescr"><p>Represents a frame in a QTextDocument</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextobject.html">QTextObject</a></p></td><td class="tblDescr"><p>Base class for different kinds of objects that can group parts of a QTextDocument together</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextframe-iterator.html">QTextFrame::iterator</a></p></td><td class="tblDescr"><p>Iterator for reading the contents of a QTextFrame</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtextblock-iterator.html">QTextBlock::iterator</a></p></td><td class="tblDescr"><p>QTextBlock::iterator class provides an iterator for reading the contents of a QTextBlock</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtextoption.html">QTextOption</a></p></td><td class="tblDescr"><p>Description of general rich text properties</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="qtexttable.html">QTextTable</a></p></td><td class="tblDescr"><p>Represents a table in a QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="qtexttablecell.html">QTextTableCell</a></p></td><td class="tblDescr"><p>Represents the properties of a cell in a QTextTable</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="../qtwidgets/qplaintextdocumentlayout.html">QPlainTextDocumentLayout</a></p></td><td class="tblDescr"><p>Implements a plain text layout for QTextDocument</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="../qtwidgets/qplaintextedit.html">QPlainTextEdit</a></p></td><td class="tblDescr"><p>Widget that is used to edit and display plain text</p></td></tr> <tr class="even topAlign"><td class="tblName"><p><a href="../qtwidgets/qtextbrowser.html">QTextBrowser</a></p></td><td class="tblDescr"><p>Rich text browser with hypertext navigation</p></td></tr> <tr class="odd topAlign"><td class="tblName"><p><a href="../qtwidgets/qtextedit.html">QTextEdit</a></p></td><td class="tblDescr"><p>Widget that is used to edit and display both plain and rich text</p></td></tr> </table></div> </div> <!-- @@@richtext.html --> <p class="naviNextPrevious footerNavi"> <a class="nextPage" href="richtext-structure.html">Rich Text Document Structure</a> </p> </div> </div> </div> </div> </div> <div class="footer"> <p> <acronym title="Copyright">©</acronym> 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners.<br> The documentation provided herein is licensed under the terms of the <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License version 1.3</a> as published by the Free Software Foundation.<br> Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners. </p> </div> </body> </html>