QPlainTextDocumentLayout Class▲
-
Header: QPlainTextDocumentLayout
-
CMake:
find_package(Qt6 REQUIRED COMPONENTS Widgets)
target_link_libraries(mytarget PRIVATE Qt6::Widgets)
-
qmake: QT += widgets
-
Inherits: QAbstractTextDocumentLayout
-
Group: QPlainTextDocumentLayout is part of richtext-processing
Detailed Description▲
A QPlainTextDocumentLayout is required for text documents that can be display or edited in a QPlainTextEdit. See QTextDocument::setDocumentLayout().
QPlainTextDocumentLayout uses the QAbstractTextDocumentLayout API that QTextDocument requires, but redefines it partially in order to support plain text better. For instances, it does not operate on vertical pixels, but on paragraphs (called blocks) instead. The height of a document is identical to the number of paragraphs it contains. The layout also doesn't support tables or nested frames, or any sort of advanced text layout that goes beyond a list of paragraphs with syntax highlighting.
Property Documentation▲
cursorWidth : int▲
This property specifies the width of the cursor in pixels. The default value is 1.
Access functions:
-
int cursorWidth() const
-
void setCursorWidth(int width)
Member Function Documentation▲
QPlainTextDocumentLayout::QPlainTextDocumentLayout(QTextDocument *document)▲
Constructs a plain text document layout for the text document.
[virtual] QPlainTextDocumentLayout::~QPlainTextDocumentLayout()▲
Destructs a plain text document layout.
[override virtual] QRectF QPlainTextDocumentLayout::blockBoundingRect(const QTextBlock &block) const▲
[override virtual protected] void QPlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int charsAdded)▲
Reimplements: QAbstractTextDocumentLayout::documentChanged(int position, int charsRemoved, int charsAdded).
[override virtual] QSizeF QPlainTextDocumentLayout::documentSize() const▲
Reimplements: QAbstractTextDocumentLayout::documentSize() const.
[override virtual] void QPlainTextDocumentLayout::draw(QPainter *, const QAbstractTextDocumentLayout::PaintContext &)▲
Reimplements: QAbstractTextDocumentLayout::draw(QPainter *painter, const QAbstractTextDocumentLayout::PaintContext &context).
void QPlainTextDocumentLayout::ensureBlockLayout(const QTextBlock &block) const▲
Ensures that block has a valid layout
[override virtual] QRectF QPlainTextDocumentLayout::frameBoundingRect(QTextFrame *) const▲
[override virtual] int QPlainTextDocumentLayout::hitTest(const QPointF &, Qt::HitTestAccuracy) const▲
Reimplements: QAbstractTextDocumentLayout::hitTest(const QPointF &point, Qt::HitTestAccuracy accuracy) const.
[override virtual] int QPlainTextDocumentLayout::pageCount() const▲
Reimplements: QAbstractTextDocumentLayout::pageCount() const.
void QPlainTextDocumentLayout::requestUpdate()▲
Requests a complete update on all views.