Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

QTextFrame Class Reference

The QTextFrame class represents a frame in a QTextDocument. More...

#include <QTextFrame>

Inherits QTextObject.

Inherited by QTextTable.

List of all members.

Public Types

Writable Properties

Public Functions

Public Slots

Signals

Static Public Members

Protected Functions


Detailed Description

The QTextFrame class represents a frame in a QTextDocument.

Each frame in a document consists of a frame start character, QChar(0xFDD0), followed by the frame's contents, followed by a frame end character, QChar(0xFDD1). The character formats of the start and end character contain a reference to the frame object's objectIndex.

Frames can be used to create hierarchical documents. Each document has a root frame (QTextDocument::rootFrame()), and each frame (except for the root frame), has a parentFrame() and a (possibly empty) list of child frames. In addition to containing childFrames(), a frame can also contain QTextBlocks. A frame also has a format (setFormat(), format()). The positions in a frame are available from firstCursorPosition() and lastCursorPosition(), and the frame's position in the document from firstPosition() and lastPosition().

Frames are usually created using QTextCursor::insertFrame().

You can iterate over frame's contents using the QTextFrame::iterator class: this provides read-only access to a frame's list of blocks and child frames.


Member Type Documentation

typedef QTextFrame::Iterator


Member Function Documentation

QTextFrame::QTextFrame ( QTextDocument * doc )

Creates a new empty frame for the text document, doc.

QTextFrame::~QTextFrame ()

Destroys this frame and removes it from the document's layout.

iterator QTextFrame::begin () const

Returns an iterator pointing to the first block inside the frame.

See also end().

QList<QTextFrame *> QTextFrame::childFrames ()

Returns a (possibly empty) list of this frame's child frames.

See also parentFrame().

iterator QTextFrame::end () const

Returns an iterator pointing to the last block inside the frame.

See also begin().

QTextCursor QTextFrame::firstCursorPosition () const

Returns the first cursor position inside the frame.

See also lastCursorPosition(), firstPosition(), and lastPosition().

int QTextFrame::firstPosition () const

Returns the first document position inside the frame.

See also lastPosition(), firstCursorPosition(), and lastCursorPosition().

QTextFrameFormat QTextFrame::format () const

Returns the frame's format.

See also setFormat().

QTextCursor QTextFrame::lastCursorPosition () const

Returns the last cursor position inside the frame.

See also firstCursorPosition(), firstPosition(), and lastPosition().

int QTextFrame::lastPosition () const

Returns the last document position inside the frame.

See also firstPosition(), firstCursorPosition(), and lastCursorPosition().

QTextFrame * QTextFrame::parentFrame ()

Returns this frame's parent frame (which will be 0 if this frame is the QTextDocument::rootFrame()).

See also childFrames().

void QTextFrame::setFormat ( const QTextFrameFormat & format )

Sets the frame's format.

See also format().


Copyright © 2004 Trolltech. Trademarks
Qt 4.0.0-tp1