Auf dieser Seite

Utils::PlainTextDocumentLayout Class

class Utils::PlainTextDocumentLayout

Die Klasse „PlainTextDocumentLayout“ implementiert ein Layout für einfachen Text für „ QTextDocument “. Mehr...

Header: #include <PlainTextDocumentLayout>

Eigenschaften

Öffentliche Funktionen

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)

Geschützte Funktionen

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

Ausführliche Beschreibung

Für Textdokumente, die in einem „ PlainTextEdit “ angezeigt oder bearbeitet werden können, ist ein „PlainTextDocumentLayout“ erforderlich. Siehe QTextDocument::setDocumentLayout().

„PlainTextDocumentLayout“ nutzt die von „ QTextDocument “ benötigte „ QAbstractTextDocumentLayout “-API, definiert diese jedoch teilweise neu, um reinen Text besser zu unterstützen. Beispielsweise arbeitet es nicht mit vertikalen Pixeln, sondern stattdessen mit Absätzen (sogenannten Blöcken). Die Höhe eines Dokuments entspricht der Anzahl der darin enthaltenen Absätze. Das Layout unterstützt zudem keine Tabellen oder verschachtelten Rahmen sowie keinerlei fortgeschrittene Textlayouts, die über eine Liste von Absätzen mit Syntaxhervorhebung hinausgehen.

Dokumentation zu den Eigenschaften

cursorWidth : int

Diese Eigenschaft legt die Breite des Cursors in Pixeln fest. Der Standardwert ist 1.

Zugriffsfunktionen:

int cursorWidth() const
void setCursorWidth(int width)

Dokumentation zu den Member-Funktionen

PlainTextDocumentLayout::PlainTextDocumentLayout(QTextDocument *document)

Erstellt ein Layout für ein Klartextdokument mit dem Text „ document “.

[noexcept] PlainTextDocumentLayout::~PlainTextDocumentLayout()

Löscht das Layout eines Klartextdokuments.

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

Fordert eine vollständige Aktualisierung aller Ansichten an.

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.