IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Rich Text Processing

An overview of Qt's rich text processing, editing and display features.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Rich Text Processing

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 Processing APIs

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

  • QAbstractTextDocumentLayout: The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments.

  • QFont: The QFont class specifies a query for a font used for drawing text.

  • QSyntaxHighlighter: The QSyntaxHighlighter class 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: The QTextBlock class provides a container for text fragments in a QTextDocument.

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

  • QTextBlockFormat: The QTextBlockFormat class provides formatting information for blocks of text in a QTextDocument.

  • QTextBlockGroup: The QTextBlockGroup class provides a container for text blocks within a QTextDocument.

  • QTextBlockUserData: The QTextBlockUserData class is used to associate custom data with blocks of text.

  • QTextCharFormat: The QTextCharFormat class provides formatting information for characters in a QTextDocument.

  • QTextCursor: The QTextCursor class offers an API to access and modify QTextDocuments.

  • QTextDocument: The QTextDocument class holds formatted text.

  • QTextDocumentFragment: The QTextDocumentFragment class represents a piece of formatted text from a QTextDocument.

  • QTextDocumentWriter: The QTextDocumentWriter class provides a format-independent interface for writing a QTextDocument to files or other devices.

  • QTextFormat: The QTextFormat class provides formatting information for a QTextDocument.

  • QTextFragment: The QTextFragment class holds a piece of text in a QTextDocument with a single QTextCharFormat.

  • QTextFrame: The QTextFrame class represents a frame in a QTextDocument.

  • QTextFrame::iterator: The iterator class provides an iterator for reading the contents of a QTextFrame.

  • QTextFrameFormat: The QTextFrameFormat class provides formatting information for frames in a QTextDocument.

  • QTextImageFormat: The QTextImageFormat class provides formatting information for images in a QTextDocument.

  • QTextInlineObject: The QTextInlineObject class represents an inline object in a QAbstractTextDocumentLayout and its implementations.

  • QTextLayout: The QTextLayout class is used to lay out and render text.

  • QTextLength: The QTextLength class encapsulates the different types of length used in a QTextDocument.

  • QTextLine: The QTextLine class represents a line of text inside a QTextLayout.

  • QTextList: The QTextList class provides a decorated list of items in a QTextDocument.

  • QTextListFormat: The QTextListFormat class provides formatting information for lists in a QTextDocument.

  • QTextObject: The QTextObject class is a base class for different kinds of objects that can group parts of a QTextDocument together.

  • QTextOption: The QTextOption class provides a description of general rich text properties.

  • QTextTable: The QTextTable class represents a table in a QTextDocument.

  • QTextTableCell: The QTextTableCell class represents the properties of a cell in a QTextTable.

  • QTextTableCellFormat: The QTextTableCellFormat class provides formatting information for table cells in a QTextDocument.

  • QTextTableFormat: The QTextTableFormat class provides formatting information for tables in a QTextDocument.

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+