Na této stránce

Utils::PlainTextDocumentLayout Class

class Utils::PlainTextDocumentLayout

Třída PlainTextDocumentLayout implementuje rozvržení prostého textu pro QTextDocument. Více...

Header: #include <PlainTextDocumentLayout>

Vlastnosti

Veřejné funkce

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)

Chráněné funkce

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

Podrobný popis

Pro textové dokumenty, které lze zobrazit nebo upravovat v aplikaci PlainTextEdit, je vyžadován objekt PlainTextDocumentLayout. Viz QTextDocument::setDocumentLayout().

PlainTextDocumentLayout využívá rozhraní API QAbstractTextDocumentLayout, které vyžaduje QTextDocument, ale částečně jej předefinovává, aby lépe podporovalo prostý text. Například nepracuje s vertikálními pixely, ale místo toho s odstavci (nazývanými bloky). Výška dokumentu se rovná počtu odstavců, které obsahuje. Rozvržení také nepodporuje tabulky ani vnořené rámce, ani žádný druh pokročilého rozvržení textu, které by přesahovalo seznam odstavců se zvýrazněním syntaxe.

Dokumentace vlastností

cursorWidth : int

Tato vlastnost určuje šířku kurzoru v pixelech. Výchozí hodnota je 1.

Funkce Accessu:

int cursorWidth() const
void setCursorWidth(int width)

Dokumentace členských funkcí

PlainTextDocumentLayout::PlainTextDocumentLayout(QTextDocument *document)

Vytvoří rozvržení dokumentu v prostém textu pro text document.

[noexcept] PlainTextDocumentLayout::~PlainTextDocumentLayout()

Zruší rozvržení dokumentu v prostém textu.

[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()

Žádá o úplný přehled všech názorů.

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.