6.0.0-rc4Source

QAbstractTextDocumentLayout Class

The QAbstractTextDocumentLayout class is an abstract base class used to implement custom layouts for QTextDocuments. More…

Header#include <QAbstractTextDocumentLayout>
CMaketarget_link_libraries(app PRIVATE Nt::Gui)
ModuleNt GUI C++ Classes

List of all members, including inherited members

Public Functions

QStringanchorAt(const QPointF &pos) const
QSizeFdocumentSize() const
QRectFblockBoundingRect(const QTextBlock &block) const
QTextDocument *document() const

Detailed Description

In Nt this class is what QTextDocument::documentLayout() returns: it answers questions about where things are in the document as it is laid out: the link at a point, the rectangle of a paragraph, and the size of the whole.

See also QTextDocument.

Differences from Qt

This is not a base class for layouts of an application, and not a QObject: it has no signals, no draw(), hitTest() or formatAt(), and a document cannot be given another layout.

Member Function Documentation

QString QAbstractTextDocumentLayout::anchorAt(const QPointF &pos) const

Returns the target of the link at the position pos of the document, or an empty string if there is no link there.

See also QTextCharFormat::anchorHref().

QRectF QAbstractTextDocumentLayout::blockBoundingRect(const QTextBlock &block) const

Returns the rectangle that block takes in the document, or an empty rectangle if it is not a block of this document.

QTextDocument * QAbstractTextDocumentLayout::document() const

Returns the document that this is the layout of.

QSizeF QAbstractTextDocumentLayout::documentSize() const

Returns the size of the document as it is laid out; the same as QTextDocument::size().