QtBase
v6.3.1
|
The QTextObject class is a base class for different kinds of objects that can group parts of a QTextDocument together. \inmodule QtGui. More...
#include <qtextobject.h>
Protected Member Functions | |
QTextObject (QTextDocument *doc) | |
~QTextObject () | |
void | setFormat (const QTextFormat &format) |
QTextObject (QTextObjectPrivate &p, QTextDocument *doc) | |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
virtual void | childEvent (QChildEvent *event) |
virtual void | customEvent (QEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Friends | |
class | QTextDocumentPrivate |
The QTextObject class is a base class for different kinds of objects that can group parts of a QTextDocument together. \inmodule QtGui.
\reentrant
The common grouping text objects are lists (QTextList), frames (QTextFrame), and tables (QTextTable). A text object has an associated format() and document().
There are essentially two kinds of text objects: those that are used with blocks (block formats), and those that are used with characters (character formats). The first kind are derived from QTextBlockGroup, and the second kind from QTextFrame.
You rarely need to use this class directly. When creating custom text objects, you will also need to reimplement QTextDocument::createObject() which acts as a factory method for creating text objects.
Definition at line 60 of file qtextobject.h.
|
explicitprotected |
Creates a new QTextObject for the given document.
Definition at line 92 of file qtextobject.cpp.
|
protected |
Destroys the text object.
Definition at line 113 of file qtextobject.cpp.
|
protected |
Definition at line 102 of file qtextobject.cpp.
QTextDocument * QTextObject::document | ( | ) | const |
Returns the document this object belongs to.
Definition at line 168 of file qtextobject.cpp.
QTextFormat QTextObject::format | ( | ) | const |
Returns the text object's format.
Definition at line 122 of file qtextobject.cpp.
int QTextObject::formatIndex | ( | ) | const |
Returns the index of the object's format in the document's internal list of formats.
Definition at line 134 of file qtextobject.cpp.
int QTextObject::objectIndex | ( | ) | const |
Returns the object index of this object. This can be used together with QTextFormat::setObjectIndex().
Definition at line 157 of file qtextobject.cpp.
|
protected |
Sets the text object's format.
Definition at line 146 of file qtextobject.cpp.
|
friend |
Definition at line 84 of file qtextobject.h.