QTextObject Class▲
-
Header: QTextObject
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
-
qmake: QT += gui
-
Inherits: QObject
-
Inherited By: QTextBlockGroup and QTextFrame
-
Group: QTextObject is part of Rich Text Processing APIs
Detailed Description▲
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.
See Also▲
See also QTextDocument, Text Object Example
Member Function Documentation▲
[explicit protected] QTextObject::QTextObject(QTextDocument *document)▲
Creates a new QTextObject for the given document.
This function should never be called directly, but only from QTextDocument::createObject().
[virtual protected] QTextObject::~QTextObject()▲
Destroys the text object.
Text objects are owned by the document, so you should never destroy them yourself.
QTextDocument *QTextObject::document() const▲
QTextFormat QTextObject::format() const▲
int QTextObject::formatIndex() const▲
Returns the index of the object's format in the document's internal list of formats.
See Also▲
See also QTextDocument::allFormats()
int QTextObject::objectIndex() const▲
Returns the object index of this object. This can be used together with QTextFormat::setObjectIndex().