Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

QTextFrame Class Reference

Inheritance diagram for QTextFrame:

QTextObject QObject QTextTable

List of all members.

Detailed Description

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().

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

Definition at line 121 of file qtextobject.h.

Public Types

typedef iterator Iterator

Public Slots

void deleteLater ()


void destroyed (QObject *=0)

Public Member Functions

iterator begin () const
bool blockSignals (bool b)
QList< QTextFrame * > childFrames () const
const QObjectListchildren () const
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const QObject *receiver, const char *member=0)
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
QTextDocumentPrivate * docHandle () const
QTextDocumentdocument () const
void dumpObjectInfo ()
void dumpObjectTree ()
QList< QByteArraydynamicPropertyNames () const
iterator end () const
virtual bool event (QEvent *)
virtual bool eventFilter (QObject *, QEvent *)
template<typename T>
findChild (const QString &name=QString()) const
template<typename T>
QList< T > findChildren (const QRegExp &re) const
template<typename T>
QList< T > findChildren (const QString &name=QString()) const
QTextCursor firstCursorPosition () const
int firstPosition () const
QTextFormat format () const
int formatIndex () const
QTextFrameFormat frameFormat () const
bool inherits (const char *classname) const
void installEventFilter (QObject *)
bool isWidgetType () const
void killTimer (int id)
QTextCursor lastCursorPosition () const
int lastPosition () const
QTextFrameLayoutData * layoutData () const
void moveToThread (QThread *thread)
int objectIndex () const
QString objectName () const
QObjectparent () const
QTextFrameparentFrame () const
QVariant property (const char *name) const
 QTextFrame (QTextDocument *doc)
void removeEventFilter (QObject *)
void setFrameFormat (const QTextFrameFormat &format)
void setLayoutData (QTextFrameLayoutData *data)
void setObjectName (const QString &name)
void setParent (QObject *)
bool setProperty (const char *name, const QVariant &value)
void setUserData (uint id, QObjectUserData *data)
bool signalsBlocked () const
int startTimer (int interval)
QThreadthread () const
QObjectUserData * userData (uint id) const
 ~QTextFrame ()

Static Public Member Functions

static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
static uint registerUserData ()

Protected Member Functions

virtual void childEvent (QChildEvent *)
virtual void connectNotify (const char *signal)
virtual void customEvent (QEvent *)
virtual void disconnectNotify (const char *signal)
 QTextFrame (QTextFramePrivate &p, QTextDocument *doc)
int receivers (const char *signal) const
QObjectsender () const
void setFormat (const QTextFormat &format)
virtual void timerEvent (QTimerEvent *)

Protected Attributes

QObjectData * d_ptr

Static Protected Attributes

static const QMetaObject staticQtMetaObject


QString objectName
 the name of this object


class QApplication
class QApplicationPrivate
class QCoreApplication
class QCoreApplicationPrivate
struct QMetaObject
class QTextDocumentPrivate
class QThreadData
class QWidget

Related Functions

(Note that these are not member functions.)

qFindChild (const QObject *obj, const QString &name=QString(), T dummy=0)
qFindChild (const QObject *obj, const QString &name)
QList< T > qFindChildren (const QObject *obj, const QString &name=QString(), T dummy=0)
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
QList< T > qFindChildren (const QObject *obj, const QString &name)
T * qobject_cast (QObject *object)
void * qt_find_obj_child (QObject *parent, const char *type, const QString &name)


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

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index