视频教程     下载中心     Wiki     联络 登录   注册

Log
  1. 首页
  2. Qt 5.12.9
  3. Qt GUI
  4. 富文本处理

Rich Text Document Structure

内容

  • Rich Text Processing APIs

富文本处理

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 QTextDocument 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.

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.

This document is divided up into chapters for convenient reference:

  • Rich Text Document Structure outlines the different kinds of elements in a QTextDocument , and describes how they are arranged in a document structure.
  • The QTextCursor Interface explains how rich text documents can be edited using the cursor-based interface.
  • Document Layouts briefly explains the role of document layouts.
  • Common Rich Text Editing Tasks examines some common tasks that involve reading or manipulating rich text documents.
  • Advanced Rich Text Processing examines advanced rich text editing tasks.
  • 支持的 HTML 子集 lists the HTML tags supported by QTextDocument .

Rich Text Processing APIs

Qt provides an extensive collection of classes for parsing, rendering manipulating and editing rich text.

QAbstractTextDocumentLayout

Abstract base class used to implement custom layouts for QTextDocuments

QFont

Specifies a font used for drawing text

QPlainTextDocumentLayout

用于 QTextDocument 的纯文本布局实现

QPlainTextEdit

用于编辑和显示纯文本的 Widget

QSyntaxHighlighter

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

QTextBlock

用于 QTextDocument 中文本片段的容器

QTextBlockFormat

Formatting information for blocks of text in a QTextDocument

QTextBlockGroup

Container for text blocks within a QTextDocument

QTextBlockUserData

Used to associate custom data with blocks of text

QTextBrowser

带 Hypertext (超文本) 导航的富文本浏览器

QTextCharFormat

Formatting information for characters in a QTextDocument

QTextCursor

Offers an API to access and modify QTextDocuments

QTextDocument

保持格式化文本

QTextDocumentFragment

表示一块来自 QTextDocument 的格式化文本

QTextDocumentWriter

Format-independent interface for writing a QTextDocument to files or other devices

QTextEdit

用于编辑和显示纯文本 富文本两者的 Widget

QTextFormat

Formatting information for a QTextDocument

QTextFragment

Holds a piece of text in a QTextDocument with a single QTextCharFormat

QTextFrame

Represents a frame in a QTextDocument

QTextFrameFormat

Formatting information for frames in a QTextDocument

QTextImageFormat

Formatting information for images in a QTextDocument

QTextInlineObject

Represents an inline object in a QAbstractTextDocumentLayout and its implementations

QTextLayout

Used to lay out and render text

QTextLength

Encapsulates the different types of length used in a QTextDocument

QTextLine

Represents a line of text inside a QTextLayout

QTextList

Decorated list of items in a QTextDocument

QTextListFormat

Formatting information for lists in a QTextDocument

QTextObject

Base class for different kinds of objects that can group parts of a QTextDocument together

QTextOption

一般富文本特性的描述

QTextTable

Represents a table in a QTextDocument

QTextTableCell

Represents the properties of a cell in a QTextTable

QTextTableCellFormat

Formatting information for table cells in a QTextDocument

QTextTableFormat

Formatting information for tables in a QTextDocument

QTextFrame::iterator

Iterator for reading the contents of a QTextFrame

QTextBlock::iterator

QTextBlock::iterator class provides an iterator for reading the contents of a QTextBlock

Rich Text Document Structure

版权所有  © 2014-2021 乐数软件    

工业和信息化部 : 粤ICP备14079481号-1