QTextFrame Class Reference |
class | iterator |
typedef | Iterator |
QTextFrame ( QTextDocument * document ) | |
~QTextFrame () | |
iterator | begin () const |
QList<QTextFrame *> | childFrames () const |
iterator | end () const |
QTextCursor | firstCursorPosition () const |
int | firstPosition () const |
QTextFrameFormat | frameFormat () const |
QTextCursor | lastCursorPosition () const |
int | lastPosition () const |
QTextFrame * | parentFrame () const |
void | setFrameFormat ( const QTextFrameFormat & format ) |
The QTextFrame class represents a frame in a QTextDocument.
Text frames provide structure for the text in a document. They are used as generic containers for other document elements. Frames are usually created by using QTextCursor::insertFrame().
Frames can be used to create hierarchical structures in rich text documents. Each document has a root frame (QTextDocument::rootFrame()), and each frame beneath the root frame has a parent frame and a (possibly empty) list of child frames. The parent frame can be found with parentFrame(), and the childFrames() function provides a list of child frames.
Each frame contains at least one text block to enable text cursors to insert new document elements within. As a result, the QTextFrame::iterator class is used to traverse both the blocks and child frames within a given frame. The first and last child elements in the frame can be found with begin() and end().
A frame also has a format (specified using QTextFrameFormat) which can be set with setFormat() and read with format().
Text cursors can be obtained that point to the first and last valid cursor positions within a frame; use the firstCursorPosition() and lastCursorPosition() functions for this. The frame's extent in the document can be found with firstPosition() and lastPosition().
You can iterate over a frame's contents using the QTextFrame::iterator class: this provides read-only access to its internal list of text blocks and child frames.
See also QTextCursor and QTextDocument.
Qt-style synonym for QTextFrame::iterator.
Creates a new empty frame for the text document.
Destroys the frame, and removes it from the document's layout.
Returns an iterator pointing to the first document element inside the frame.
See also end().
Returns a (possibly empty) list of the frame's child frames.
See also parentFrame().
Returns an iterator pointing to the last document element inside the frame.
See also begin().
Returns the first cursor position inside the frame.
See also lastCursorPosition(), firstPosition(), and lastPosition().
Returns the first document position inside the frame.
See also lastPosition(), firstCursorPosition(), and lastCursorPosition().
Returns the frame's format.
See also setFrameFormat().
Returns the last cursor position inside the frame.
See also firstCursorPosition(), firstPosition(), and lastPosition().
Returns the last document position inside the frame.
See also firstPosition(), firstCursorPosition(), and lastCursorPosition().
Returns the frame's parent frame. If the frame is the root frame of a document, this will return 0.
See also childFrames() and QTextDocument::rootFrame().
Sets the frame's format.
See also frameFormat().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6 | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com