- Qt 6.7
- Qt Quick
- C++ Classes
- QQuickTextDocument
- Qt 6.7.1 Reference Documentation

# QQuickTextDocument Class

The QQuickTextDocument class provides access to the QTextDocument of QQuickTextEdit. More...

Header: | #include <QQuickTextDocument>
CMake: | find_package(Qt6 REQUIRED COMPONENTS Quick) target_link_libraries(mytarget PRIVATE Qt6::Quick)
qmake: | QT += quick
Instantiated By: | TextDocument
Inherits: | QObject

- List of all members, including inherited members

## Public Functions

| QQuickTextDocument(QQuickItem *parent)
QString | errorString() const
bool | isModified() const
void | setModified(bool modified)
void | setSource(const QUrl &url)
`(since 6.7)` void | setTextDocument(QTextDocument *document)
QUrl | source() const
QQuickTextDocument::Status | status() const
QTextDocument * | textDocument() const

## Signals

void | errorStringChanged()
void | modifiedChanged()
void | sourceChanged()
void | statusChanged()
`(since 6.7)` void | textDocumentChanged()

## Detailed Description

This class provides access to the QTextDocument of QQuickTextEdit elements. This is provided to allow usage of the Rich Text Processing functionalities of Qt, including document modifications. It can also be used to output content, for example with QTextDocumentWriter), or provide additional formatting, for example with QSyntaxHighlighter.

## Member Function Documentation

### QQuickTextDocument::QQuickTextDocument(QQuickItem *parent)

Constructs a QQuickTextDocument object with parent as the parent object.

### `[since 6.7]` void QQuickTextDocument::setTextDocument(QTextDocument *document)

Sets the given document.

The caller retains ownership of the document.

This function was introduced in Qt 6.7.

See also textDocument().

### QTextDocument *QQuickTextDocument::textDocument() const

Returns a pointer to the QTextDocument object.

See also setTextDocument().

### `[signal, since 6.7]` void QQuickTextDocument::textDocumentChanged()

This signal is emitted when the underlying QTextDocument is replaced with a different instance.

This function was introduced in Qt 6.7.

See also setTextDocument().