Na tej stronie

Utils::PlainTextDocumentLayout Class

class Utils::PlainTextDocumentLayout

Klasa `PlainTextDocumentLayout` realizuje układ tekstu zwykłego dla strony QTextDocument. Więcej...

Header: #include <PlainTextDocumentLayout>

Właściwości

Funkcje publiczne

PlainTextDocumentLayout(QTextDocument *document)
~PlainTextDocumentLayout()
int cursorWidth() const
QSizeF documentSize() const
void draw(QPainter *, const int &) override
int hitTest(const QPointF &, Qt::HitTestAccuracy) const
int pageCount() const
void requestUpdate()
void setCursorWidth(int width)

Funkcje chronione

void documentChanged(int from, int charsRemoved, int charsAdded)

Szczegółowy opis

Obiekt typu PlainTextDocumentLayout jest wymagany dla dokumentów tekstowych, które mogą być wyświetlane lub edytowane w interfejsie PlainTextEdit. Zobacz QTextDocument::setDocumentLayout().

PlainTextDocumentLayout korzysta z interfejsu API QAbstractTextDocumentLayout wymaganego przez QTextDocument, ale częściowo go redefiniuje w celu lepszej obsługi zwykłego tekstu. Na przykład nie operuje on na pikselach w pionie, lecz na akapitach (zwanych blokami). Wysokość dokumentu jest równa liczbie zawartych w nim akapitów. Układ ten nie obsługuje również tabel ani zagnieżdżonych ramek, ani żadnego rodzaju zaawansowanego układu tekstu wykraczającego poza listę akapitów z podświetleniem składni.

Dokumentacja właściwości

cursorWidth : int

Ta właściwość określa szerokość kursora w pikselach. Wartością domyślną jest 1.

Funkcje Access:

int cursorWidth() const
void setCursorWidth(int width)

Dokumentacja funkcji składowych

PlainTextDocumentLayout::PlainTextDocumentLayout(QTextDocument *document)

Tworzy układ dokumentu w postaci zwykłego tekstu dla treści document.

[noexcept] PlainTextDocumentLayout::~PlainTextDocumentLayout()

Usuwa układ dokumentu zawierającego zwykły tekst.

[protected] void PlainTextDocumentLayout::documentChanged(int from, int charsRemoved, int charsAdded)

QSizeF PlainTextDocumentLayout::documentSize() const

void PlainTextDocumentLayout::draw(QPainter *, const int &)

int PlainTextDocumentLayout::hitTest(const QPointF &, Qt::HitTestAccuracy) const

int PlainTextDocumentLayout::pageCount() const

void PlainTextDocumentLayout::requestUpdate()

Prosi o pełną aktualizację wszystkich widoków.

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.